summary refs log tree commit diff
path: root/crypto/src/asn1/DerSet.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/DerSet.cs')
-rw-r--r--crypto/src/asn1/DerSet.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/asn1/DerSet.cs b/crypto/src/asn1/DerSet.cs
index 3818d286f..0808434d7 100644
--- a/crypto/src/asn1/DerSet.cs
+++ b/crypto/src/asn1/DerSet.cs
@@ -70,17 +70,17 @@ namespace Org.BouncyCastle.Asn1
 		 * ASN.1 descriptions given. Rather than just outputing Set,
 		 * we also have to specify Constructed, and the objects length.
 		 */
-        internal override void Encode(DerOutputStream derOut)
+        internal override void Encode(Asn1OutputStream asn1Out)
         {
             if (Count < 1)
             {
-                derOut.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, Asn1OctetString.EmptyOctets);
+                asn1Out.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, Asn1OctetString.EmptyOctets);
                 return;
             }
 
             // TODO Intermediate buffer could be avoided if we could calculate expected length
             MemoryStream bOut = new MemoryStream();
-            DerOutputStream dOut = new DerOutputStream(bOut);
+            Asn1OutputStream dOut = Asn1OutputStream.Create(bOut, Asn1Encodable.Der);
 
             foreach (Asn1Encodable obj in this)
             {
@@ -97,7 +97,7 @@ namespace Org.BouncyCastle.Asn1
             int length = (int)bOut.Position;
 #endif
 
-            derOut.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, bytes, 0, length);
+            asn1Out.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, bytes, 0, length);
 
             Platform.Dispose(dOut);
         }