summary refs log tree commit diff
path: root/crypto/src/pkcs/Pkcs10CertificationRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/pkcs/Pkcs10CertificationRequest.cs')
-rw-r--r--crypto/src/pkcs/Pkcs10CertificationRequest.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs
index 59b5b51ed..12151a001 100644
--- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs
+++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs
@@ -345,10 +345,10 @@ namespace Org.BouncyCastle.Pkcs
                 byte[] b = reqInfo.GetDerEncoded();
 
                 IStreamCalculator<IVerifier> streamCalculator = verifier.CreateCalculator();
-
-                streamCalculator.Stream.Write(b, 0, b.Length);
-
-                Platform.Dispose(streamCalculator.Stream);
+                using (var stream = streamCalculator.Stream)
+                {
+                    stream.Write(b, 0, b.Length);
+                }
 
                 return streamCalculator.GetResult().IsVerified(sigBits.GetOctets());
             }