summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-08 10:17:25 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-08 10:17:25 +0700
commitf7a4914baf61fb71f93dd62029089a3599e9b17b (patch)
treea0dd3e17d424b707acf91ec075a54c6d0804c8c0
parentUse utility method from Enums to avoid platform-specific code here (diff)
downloadBouncyCastle.NET-ed25519-f7a4914baf61fb71f93dd62029089a3599e9b17b.tar.xz
Missed a Close/Dispose change
-rw-r--r--crypto/src/x509/X509V3CertificateGenerator.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/src/x509/X509V3CertificateGenerator.cs b/crypto/src/x509/X509V3CertificateGenerator.cs
index 51488bd2a..bc619c37b 100644
--- a/crypto/src/x509/X509V3CertificateGenerator.cs
+++ b/crypto/src/x509/X509V3CertificateGenerator.cs
@@ -1,15 +1,14 @@
 using System;
 using System.Collections;
-using System.IO;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Operators;
-using Org.BouncyCastle.Crypto.Parameters;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Security;
 using Org.BouncyCastle.Security.Certificates;
+using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.X509.Extension;
 
 namespace Org.BouncyCastle.X509
@@ -318,11 +317,11 @@ namespace Org.BouncyCastle.X509
 
 			byte[] encoded = tbsCert.GetDerEncoded();
 
-			streamCalculator.Stream.Write (encoded, 0, encoded.Length);
+			streamCalculator.Stream.Write(encoded, 0, encoded.Length);
 
-            streamCalculator.Stream.Close ();
+            Platform.Dispose(streamCalculator.Stream);
 
-			return GenerateJcaObject(tbsCert, (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails, ((IBlockResult)streamCalculator.GetResult()).Collect());
+            return GenerateJcaObject(tbsCert, (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails, ((IBlockResult)streamCalculator.GetResult()).Collect());
 		}
 
 		private X509Certificate GenerateJcaObject(