summary refs log tree commit diff
path: root/crypto/src/asn1/crmf/PKIArchiveOptions.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-06-24 20:04:26 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-06-24 20:04:26 +0700
commit438dc8d53aac9b7483a2014cd4398b8275c496ab (patch)
treed4e53f01313d43c20cf32ae5c930e0d54a364114 /crypto/src/asn1/crmf/PKIArchiveOptions.cs
parentAdd TODO (diff)
downloadBouncyCastle.NET-ed25519-438dc8d53aac9b7483a2014cd4398b8275c496ab.tar.xz
ASN.1: Use GetTagged with cursor methods
- Add GetTagged method for all CHOICE types
- Make most Asn1Utilities methods public
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/crmf/PKIArchiveOptions.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/src/asn1/crmf/PKIArchiveOptions.cs b/crypto/src/asn1/crmf/PKIArchiveOptions.cs
index a702d6dc2..37e9af83e 100644
--- a/crypto/src/asn1/crmf/PKIArchiveOptions.cs
+++ b/crypto/src/asn1/crmf/PKIArchiveOptions.cs
@@ -26,10 +26,8 @@ namespace Org.BouncyCastle.Asn1.Crmf
             throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), nameof(obj));
         }
 
-        public static PkiArchiveOptions GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
-        {
-            return Asn1Utilities.GetInstanceFromChoice(taggedObject, declaredExplicit, GetInstance);
-        }
+        public static PkiArchiveOptions GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) =>
+            Asn1Utilities.GetInstanceChoice(taggedObject, declaredExplicit, GetInstance);
 
         public static PkiArchiveOptions GetOptional(Asn1Encodable element)
         {
@@ -49,6 +47,9 @@ namespace Org.BouncyCastle.Asn1.Crmf
             return null;
         }
 
+        public static PkiArchiveOptions GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit) =>
+            Asn1Utilities.GetTaggedChoice(taggedObject, declaredExplicit, GetInstance);
+
         private static Asn1Encodable GetOptionalBaseObject(Asn1TaggedObject taggedObject)
         {
             if (taggedObject.HasContextTag())