diff options
Diffstat (limited to 'crypto/src/pkcs')
-rw-r--r-- | crypto/src/pkcs/Pkcs10CertificationRequest.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs index d462fb4db..be4cbb570 100644 --- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs +++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs @@ -282,12 +282,10 @@ namespace Org.BouncyCastle.Pkcs this.reqInfo = new CertificationRequestInfo(subject, pubInfo, attributes); IStreamCalculator streamCalculator = signatureFactory.CreateCalculator(); - - byte[] reqInfoData = reqInfo.GetDerEncoded(); - - streamCalculator.Stream.Write(reqInfoData, 0, reqInfoData.Length); - - Platform.Dispose(streamCalculator.Stream); + using (Stream sigStream = streamCalculator.Stream) + { + reqInfo.EncodeTo(sigStream, Der); + } // Generate Signature. sigBits = new DerBitString(((IBlockResult)streamCalculator.GetResult()).Collect()); |