summary refs log tree commit diff
path: root/crypto/src/asn1/LazyDERSet.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-11-08 01:51:32 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-11-08 01:51:32 +0700
commit58a813a047df69785ce1180b2bcfb71d4d3c0180 (patch)
treee0b7d2e63fdc7dceb967744853ea610b6fdc9abc /crypto/src/asn1/LazyDERSet.cs
parentRemove unnecessary static references (diff)
downloadBouncyCastle.NET-ed25519-58a813a047df69785ce1180b2bcfb71d4d3c0180.tar.xz
Utility methods and guards
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/LazyDERSet.cs17
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)