summary refs log tree commit diff
path: root/crypto/src/pkcs/Pkcs12Store.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/pkcs/Pkcs12Store.cs')
-rw-r--r--crypto/src/pkcs/Pkcs12Store.cs11
1 files changed, 2 insertions, 9 deletions
diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs
index f09198694..2d7de67e6 100644
--- a/crypto/src/pkcs/Pkcs12Store.cs
+++ b/crypto/src/pkcs/Pkcs12Store.cs
@@ -1030,15 +1030,8 @@ namespace Org.BouncyCastle.Pkcs
             //
             Pfx pfx = new Pfx(mainInfo, macData);
 
-            DerOutputStream derOut;
-            if (useDerEncoding)
-            {
-                derOut = new DerOutputStream(stream);
-            }
-            else
-            {
-                derOut = new Asn1OutputStream(stream);
-            }
+            Asn1OutputStream derOut = Asn1OutputStream.Create(stream,
+                useDerEncoding ? Asn1Encodable.Der : Asn1Encodable.Ber);
 
             derOut.WriteObject(pfx);
         }