summary refs log tree commit diff
path: root/crypto/src/asn1/Asn1Object.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-10-14 18:46:47 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-10-14 18:46:47 +0700
commitc3a6083bace63a12515b08b30e4ffa42fc74a0a0 (patch)
tree694e96380bbf30b597462be7dcefe0dc4ceb7406 /crypto/src/asn1/Asn1Object.cs
parentAdd WriteElements method (diff)
downloadBouncyCastle.NET-ed25519-c3a6083bace63a12515b08b30e4ffa42fc74a0a0.tar.xz
More ASN.1 updates from bc-java
Diffstat (limited to 'crypto/src/asn1/Asn1Object.cs')
-rw-r--r--crypto/src/asn1/Asn1Object.cs18
1 files changed, 1 insertions, 17 deletions
diff --git a/crypto/src/asn1/Asn1Object.cs b/crypto/src/asn1/Asn1Object.cs
index 1abf0e0bd..d60a85348 100644
--- a/crypto/src/asn1/Asn1Object.cs
+++ b/crypto/src/asn1/Asn1Object.cs
@@ -13,23 +13,7 @@ namespace Org.BouncyCastle.Asn1
 
         public override void EncodeTo(Stream output, string encoding)
         {
-            Asn1OutputStream asn1Out = Asn1OutputStream.Create(output, encoding);
-            Asn1Object asn1Object = this;
-
-            if (Der.Equals(encoding))
-            {
-                Asn1Set asn1Set = asn1Object as Asn1Set;
-                if (null != asn1Set)
-                {
-                    /*
-                     * NOTE: Even a DerSet isn't necessarily already in sorted order (particularly from DerSetParser),
-                     * so all sets have to be converted here.
-                     */
-                    asn1Object = new DerSet(asn1Set.elements);
-                }
-            }
-
-            asn1Out.WriteObject(asn1Object);
+            Asn1OutputStream.Create(output, encoding).WriteObject(this);
         }
 
         /// <summary>Create a base ASN.1 object from a byte array.</summary>