summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:46:50 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:46:50 +0700
commit915e22e211991a8be5bfe4cd3b37650b6740acc2 (patch)
tree4548682e4fe712ef94447bc4dca0bd8acc734522
parentISAPTest fixes (diff)
downloadBouncyCastle.NET-ed25519-915e22e211991a8be5bfe4cd3b37650b6740acc2.tar.xz
Add CrlID.GetInstance methods, obsolete public constructor
-rw-r--r--crypto/src/asn1/ocsp/CrlID.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/crypto/src/asn1/ocsp/CrlID.cs b/crypto/src/asn1/ocsp/CrlID.cs
index 24dda4edf..8736b83ab 100644
--- a/crypto/src/asn1/ocsp/CrlID.cs
+++ b/crypto/src/asn1/ocsp/CrlID.cs
@@ -9,8 +9,24 @@ namespace Org.BouncyCastle.Asn1.Ocsp
         private readonly DerInteger			crlNum;
         private readonly Asn1GeneralizedTime crlTime;
 
-		// TODO Add GetInstance method(s) and make this private?
-		public CrlID(Asn1Sequence seq)
+        public static CrlID GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
+        {
+            return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+        }
+
+        public static CrlID GetInstance(object obj)
+        {
+            if (obj == null)
+                return null;
+            if (obj is CrlID crlID)
+                return crlID;
+#pragma warning disable CS0618 // Type or member is obsolete
+            return new CrlID(Asn1Sequence.GetInstance(obj));
+#pragma warning restore CS0618 // Type or member is obsolete
+        }
+
+        [Obsolete("Use 'GetInstance' instead")]
+        public CrlID(Asn1Sequence seq)
         {
 			foreach (Asn1TaggedObject o in seq)
 			{