summary refs log tree commit diff
path: root/crypto/src/cmp/ProtectedPkiMessage.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/cmp/ProtectedPkiMessage.cs
parentUpdate Asn1.Cmp from bc-java (diff)
downloadBouncyCastle.NET-ed25519-d438290428230551ff568329478b0e45e5085b44.tar.xz
Give IStreamCalculator a generic type
Diffstat (limited to 'crypto/src/cmp/ProtectedPkiMessage.cs')
-rw-r--r--crypto/src/cmp/ProtectedPkiMessage.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/cmp/ProtectedPkiMessage.cs b/crypto/src/cmp/ProtectedPkiMessage.cs
index 770fe5443..738fd8ab3 100644
--- a/crypto/src/cmp/ProtectedPkiMessage.cs
+++ b/crypto/src/cmp/ProtectedPkiMessage.cs
@@ -104,14 +104,14 @@ namespace Org.BouncyCastle.Cmp
         /// <returns>true if the provider is able to create a verifier that validates the signature, false otherwise.</returns>      
         public bool Verify(IVerifierFactory verifierFactory)
         {
-            IStreamCalculator streamCalculator = verifierFactory.CreateCalculator();
+            IStreamCalculator<IVerifier> streamCalculator = verifierFactory.CreateCalculator();
 
-            IVerifier result = (IVerifier)Process(streamCalculator);
+            IVerifier result = Process(streamCalculator);
 
             return result.IsVerified(pkiMessage.Protection.GetBytes());
         }
 
-        private object Process(IStreamCalculator streamCalculator)
+        private TResult Process<TResult>(IStreamCalculator<TResult> streamCalculator)
         {
             Asn1EncodableVector avec = new Asn1EncodableVector();
             avec.Add(pkiMessage.Header);
@@ -141,7 +141,7 @@ namespace Org.BouncyCastle.Cmp
 
             pkMacBuilder.SetParameters(parameter);
 
-            IBlockResult result = (IBlockResult)Process(pkMacBuilder.Build(password).CreateCalculator());
+            IBlockResult result = Process(pkMacBuilder.Build(password).CreateCalculator());
 
             return Arrays.ConstantTimeAreEqual(result.Collect(), this.pkiMessage.Protection.GetBytes());
         }