diff options
author | David Hook <dgh@cryptoworkshop.com> | 2021-10-07 10:53:59 +1100 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2021-10-07 10:53:59 +1100 |
commit | 134738b3af06399dc5dacfd9bc97a75e79734f4b (patch) | |
tree | cee928a608c92a2b6601685ee5c286c197e1d15a | |
parent | Fixes for new_session_ticket (diff) | |
download | BouncyCastle.NET-ed25519-134738b3af06399dc5dacfd9bc97a75e79734f4b.tar.xz |
corrected DER encoding of SET
-rw-r--r-- | crypto/src/asn1/Asn1Set.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/src/asn1/Asn1Set.cs b/crypto/src/asn1/Asn1Set.cs index 68ede2275..7b3c1ccf3 100644 --- a/crypto/src/asn1/Asn1Set.cs +++ b/crypto/src/asn1/Asn1Set.cs @@ -285,6 +285,24 @@ namespace Org.BouncyCastle.Asn1 #endif } + public override byte[] GetEncoded( + string encoding) + { + if (encoding.Equals(Der)) + { + this.Sort(); + + MemoryStream bOut = new MemoryStream(); + DerOutputStream dOut = new DerOutputStream(bOut); + + dOut.WriteObject(this); + + return bOut.ToArray(); + } + + return GetEncoded(); + } + public override string ToString() { return CollectionUtilities.ToString(elements); |