summary refs log tree commit diff
path: root/crypto/src/cmp/ProtectedPkiMessage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cmp/ProtectedPkiMessage.cs')
-rw-r--r--crypto/src/cmp/ProtectedPkiMessage.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crypto/src/cmp/ProtectedPkiMessage.cs b/crypto/src/cmp/ProtectedPkiMessage.cs
index fdcdeb90d..79394094d 100644
--- a/crypto/src/cmp/ProtectedPkiMessage.cs
+++ b/crypto/src/cmp/ProtectedPkiMessage.cs
@@ -139,12 +139,8 @@ namespace Org.BouncyCastle.Cmp
 
         private TResult Process<TResult>(IStreamCalculator<TResult> streamCalculator)
         {
-            using (var s = streamCalculator.Stream)
-            {
-                new DerSequence(m_pkiMessage.Header, m_pkiMessage.Body).EncodeTo(s, Asn1Encodable.Der);
-            }
-
-            return streamCalculator.GetResult();
+            var asn1Encodable = new DerSequence(m_pkiMessage.Header, m_pkiMessage.Body);
+            return X509Utilities.CalculateResult(streamCalculator, asn1Encodable);
         }
     }
 }