diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-08 01:51:32 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-08 01:51:32 +0700 |
commit | 58a813a047df69785ce1180b2bcfb71d4d3c0180 (patch) | |
tree | e0b7d2e63fdc7dceb967744853ea610b6fdc9abc /crypto/src/asn1/LazyDERSet.cs | |
parent | Remove unnecessary static references (diff) | |
download | BouncyCastle.NET-ed25519-58a813a047df69785ce1180b2bcfb71d4d3c0180.tar.xz |
Utility methods and guards
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/LazyDERSet.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/src/asn1/LazyDERSet.cs b/crypto/src/asn1/LazyDERSet.cs index 32d9e2691..36e7bf53c 100644 --- a/crypto/src/asn1/LazyDERSet.cs +++ b/crypto/src/asn1/LazyDERSet.cs @@ -44,6 +44,9 @@ namespace Org.BouncyCastle.Asn1 public override IEnumerator GetEnumerator() { + // TODO[asn1] Support lazy enumeration + // lock (this) if (null != encoded) return new LazyConstructionEnumeration(encoded); + Parse(); return base.GetEnumerator(); @@ -59,6 +62,20 @@ namespace Org.BouncyCastle.Asn1 } } + public override Asn1Encodable[] ToArray() + { + Parse(); + + return base.ToArray(); + } + + public override string ToString() + { + Parse(); + + return base.ToString(); + } + internal override int EncodedLength(bool withID) { lock (this) |