summary refs log tree commit diff
path: root/crypto/src/crmf
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/crmf')
-rw-r--r--crypto/src/crmf/EncryptedValueBuilder.cs2
-rw-r--r--crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs5
2 files changed, 4 insertions, 3 deletions
diff --git a/crypto/src/crmf/EncryptedValueBuilder.cs b/crypto/src/crmf/EncryptedValueBuilder.cs
index 8f220330e..d95896959 100644
--- a/crypto/src/crmf/EncryptedValueBuilder.cs
+++ b/crypto/src/crmf/EncryptedValueBuilder.cs
@@ -121,7 +121,7 @@ namespace Org.BouncyCastle.Crmf
             try
             {
                 eOut.Write(data, 0, data.Length);
-                eOut.Close();
+                Platform.Dispose(eOut);
             }
             catch (IOException e)
             {
diff --git a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
index 49d10a6bf..b7a3ae01a 100644
--- a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
+++ b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
@@ -5,6 +5,7 @@ using Org.BouncyCastle.Asn1.Crmf;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Operators;
+using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crmf
 {
@@ -40,7 +41,7 @@ namespace Org.BouncyCastle.Crmf
             byte[] d = _pubKeyInfo.GetDerEncoded();
             calc.Stream.Write(d, 0, d.Length);
             calc.Stream.Flush();
-            calc.Stream.Close();
+            Platform.Dispose(calc.Stream);
 
             this._publicKeyMAC = new PKMacValue(
                 (AlgorithmIdentifier)fact.AlgorithmDetails,
@@ -80,7 +81,7 @@ namespace Org.BouncyCastle.Crmf
             }
 
             calc.Stream.Flush();
-            calc.Stream.Close();
+            Platform.Dispose(calc.Stream);
             DefaultSignatureResult res = (DefaultSignatureResult)calc.GetResult();
             return new PopoSigningKey(popo, (AlgorithmIdentifier)signer.AlgorithmDetails, new DerBitString(res.Collect()));
         }