summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/Asn1Encodable.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/src/asn1/Asn1Encodable.cs b/crypto/src/asn1/Asn1Encodable.cs
index c7fde6e07..6314bf76f 100644
--- a/crypto/src/asn1/Asn1Encodable.cs
+++ b/crypto/src/asn1/Asn1Encodable.cs
@@ -28,10 +28,12 @@ namespace Org.BouncyCastle.Asn1
 
 				if (this is Asn1Set)
 				{
-					(this as Asn1Set).Sort();
+					dOut.WriteObject(new DerSet((this as Asn1Set).elements));
+				}
+				else
+				{
+					dOut.WriteObject(this);
 				}
-
-				dOut.WriteObject(this);
 
 				return bOut.ToArray();
 			}