diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-01 20:30:22 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-01 20:30:22 +0700 |
commit | f06dc7c2f2e578c77bdb53ff981c578c3fe017eb (patch) | |
tree | da2e616d2554028d0314681abacc5632aa523627 /crypto/src/asn1/LazyDERSet.cs | |
parent | Don't create a SecureRandom unnecessarily (diff) | |
download | BouncyCastle.NET-ed25519-f06dc7c2f2e578c77bdb53ff981c578c3fe017eb.tar.xz |
Rewrite Asn1Sequence/Set to store elements as Asn1Encodable[]
Diffstat (limited to 'crypto/src/asn1/LazyDERSet.cs')
-rw-r--r-- | crypto/src/asn1/LazyDERSet.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/src/asn1/LazyDERSet.cs b/crypto/src/asn1/LazyDERSet.cs index e6c9319dd..eac64cbbe 100644 --- a/crypto/src/asn1/LazyDERSet.cs +++ b/crypto/src/asn1/LazyDERSet.cs @@ -21,16 +21,18 @@ namespace Org.BouncyCastle.Asn1 { if (encoded != null) { - Asn1InputStream e = new LazyAsn1InputStream(encoded); + Asn1EncodableVector v = new Asn1EncodableVector(); + Asn1InputStream e = new LazyAsn1InputStream(encoded); Asn1Object o; while ((o = e.ReadObject()) != null) { - AddObject(o); + v.Add(o); } - encoded = null; - } + this.elements = v.TakeElements(); + this.encoded = null; + } } } |