summary refs log tree commit diff
path: root/crypto/src/pkcs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-11-14 01:46:02 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-11-14 01:46:02 +0700
commitc4b9868dd436cb97777c8cb1b66e8715bc6f2700 (patch)
tree3dd0d81d74f72c8fc81fb3b88991fa680a2a053e /crypto/src/pkcs
parentBigInteger changed to use uint[] internally (diff)
downloadBouncyCastle.NET-ed25519-c4b9868dd436cb97777c8cb1b66e8715bc6f2700.tar.xz
Remove unnecessary classes
Diffstat (limited to 'crypto/src/pkcs')
-rw-r--r--crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs6
-rw-r--r--crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs5
2 files changed, 6 insertions, 5 deletions
diff --git a/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs b/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs
index e18619c18..03afac8e1 100644
--- a/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs
+++ b/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs
@@ -87,9 +87,11 @@ namespace Org.BouncyCastle.Pkcs
         {
             try
             {
-                ICipherBuilder decryptorBuilder = inputDecryptorProvider.CreateDecryptorBuilder(encryptedPrivateKeyInfo.EncryptionAlgorithm);
+                ICipherBuilder decryptorBuilder = inputDecryptorProvider.CreateDecryptorBuilder(
+                    encryptedPrivateKeyInfo.EncryptionAlgorithm);
 
-                ICipher encIn = decryptorBuilder.BuildCipher(new MemoryInputStream(encryptedPrivateKeyInfo.GetEncryptedData()));
+                ICipher encIn = decryptorBuilder.BuildCipher(
+                    new MemoryStream(encryptedPrivateKeyInfo.GetEncryptedData(), false));
 
                 byte[] data;
                 using (var strm = encIn.Stream)
diff --git a/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs b/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs
index 2556a947f..23c8c7f76 100644
--- a/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs
+++ b/crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs
@@ -27,12 +27,11 @@ namespace Org.BouncyCastle.Pkcs
         /// </summary>
         /// <param name="encryptor">The encryptor to use.</param>
         /// <returns>An encrypted private key info containing the original private key info.</returns>
-        public Pkcs8EncryptedPrivateKeyInfo Build(
-            ICipherBuilder encryptor)
+        public Pkcs8EncryptedPrivateKeyInfo Build(ICipherBuilder encryptor)
         {
             try
             {
-                MemoryStream bOut = new MemoryOutputStream();
+                MemoryStream bOut = new MemoryStream();
                 ICipher cOut = encryptor.BuildCipher(bOut);
                 byte[] keyData = privateKeyInfo.GetEncoded();