From c4b9868dd436cb97777c8cb1b66e8715bc6f2700 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 14 Nov 2022 01:46:02 +0700 Subject: Remove unnecessary classes --- crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfo.cs | 6 ++++-- crypto/src/pkcs/Pkcs8EncryptedPrivateKeyInfoBuilder.cs | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'crypto/src/pkcs') 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 /// /// The encryptor to use. /// An encrypted private key info containing the original private key info. - 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(); -- cgit 1.4.1