summary refs log tree commit diff
path: root/crypto/src/x509/X509V2AttributeCertificate.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-09-20 15:19:15 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-09-20 15:19:15 +0700
commitd438290428230551ff568329478b0e45e5085b44 (patch)
tree423683961e53d42c709660dc4838d1bfb02f4a07 /crypto/src/x509/X509V2AttributeCertificate.cs
parentUpdate Asn1.Cmp from bc-java (diff)
downloadBouncyCastle.NET-ed25519-d438290428230551ff568329478b0e45e5085b44.tar.xz
Give IStreamCalculator a generic type
Diffstat (limited to 'crypto/src/x509/X509V2AttributeCertificate.cs')
-rw-r--r--crypto/src/x509/X509V2AttributeCertificate.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/src/x509/X509V2AttributeCertificate.cs b/crypto/src/x509/X509V2AttributeCertificate.cs
index 8c6ff0062..fbb4fe20f 100644
--- a/crypto/src/x509/X509V2AttributeCertificate.cs
+++ b/crypto/src/x509/X509V2AttributeCertificate.cs
@@ -182,12 +182,11 @@ namespace Org.BouncyCastle.X509
         protected virtual void CheckSignature(
             IVerifierFactory verifier)
         {
+            // TODO Compare IsAlgIDEqual in X509Certificate.CheckSignature
             if (!cert.SignatureAlgorithm.Equals(cert.ACInfo.Signature))
-			{
 				throw new CertificateException("Signature algorithm in certificate info not same as outer certificate");
-			}
 
-            IStreamCalculator streamCalculator = verifier.CreateCalculator();
+            IStreamCalculator<IVerifier> streamCalculator = verifier.CreateCalculator();
 
 			try
 			{
@@ -202,10 +201,8 @@ namespace Org.BouncyCastle.X509
 				throw new SignatureException("Exception encoding certificate info object", e);
 			}
 
-			if (!((IVerifier)streamCalculator.GetResult()).IsVerified(this.GetSignature()))
-			{
+			if (!streamCalculator.GetResult().IsVerified(this.GetSignature()))
 				throw new InvalidKeyException("Public key presented not for certificate signature");
-			}
 		}
 
 		public virtual byte[] GetEncoded()