diff options
Diffstat (limited to 'crypto/src/x509/X509Certificate.cs')
-rw-r--r-- | crypto/src/x509/X509Certificate.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs index 510f95b01..5b800efe5 100644 --- a/crypto/src/x509/X509Certificate.cs +++ b/crypto/src/x509/X509Certificate.cs @@ -680,15 +680,13 @@ namespace Org.BouncyCastle.X509 if (!IsAlgIDEqual(c.SignatureAlgorithm, c.TbsCertificate.Signature)) throw new CertificateException("signature algorithm in TBS cert not same as outer cert"); - Asn1Encodable parameters = c.SignatureAlgorithm.Parameters; + byte[] b = GetTbsCertificate(); IStreamCalculator<IVerifier> streamCalculator = verifier.CreateCalculator(); - - byte[] b = this.GetTbsCertificate(); - - streamCalculator.Stream.Write(b, 0, b.Length); - - Platform.Dispose(streamCalculator.Stream); + using (var stream = streamCalculator.Stream) + { + stream.Write(b, 0, b.Length); + } if (!streamCalculator.GetResult().IsVerified(this.GetSignature())) throw new InvalidKeyException("Public key presented not for certificate signature"); |