summary refs log tree commit diff
path: root/crypto/src/asn1/DerSet.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-10-14 17:03:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-10-14 17:03:04 +0700
commit2b93d0982010321dbbc51ecbef9c3adfb22e7860 (patch)
tree38fbf7ced481c78429877eebd7bd05e5ac458765 /crypto/src/asn1/DerSet.cs
parentNull check and reformatting (diff)
downloadBouncyCastle.NET-ed25519-2b93d0982010321dbbc51ecbef9c3adfb22e7860.tar.xz
Add WriteElements method
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/DerSet.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/src/asn1/DerSet.cs b/crypto/src/asn1/DerSet.cs
index 0808434d7..62d8873b8 100644
--- a/crypto/src/asn1/DerSet.cs
+++ b/crypto/src/asn1/DerSet.cs
@@ -81,12 +81,7 @@ namespace Org.BouncyCastle.Asn1
             // TODO Intermediate buffer could be avoided if we could calculate expected length
             MemoryStream bOut = new MemoryStream();
             Asn1OutputStream dOut = Asn1OutputStream.Create(bOut, Asn1Encodable.Der);
-
-            foreach (Asn1Encodable obj in this)
-            {
-                obj.ToAsn1Object().Encode(dOut);
-            }
-
+            dOut.WriteElements(elements);
             dOut.Flush();
 
 #if PORTABLE