summary refs log tree commit diff
path: root/crypto/src/asn1/cmp/PbmParameter.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-01 21:07:46 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-01 21:07:46 +0700
commitdb9b19e3f17a2aee8afcd673ef9327bb8646b87a (patch)
treea16cf94d902be26f7f00a5218cafa15fe28cf233 /crypto/src/asn1/cmp/PbmParameter.cs
parentAdd GetInstanceFromChoice helper (diff)
downloadBouncyCastle.NET-ed25519-db9b19e3f17a2aee8afcd673ef9327bb8646b87a.tar.xz
Overhaul Asn1.Cmp
Diffstat (limited to 'crypto/src/asn1/cmp/PbmParameter.cs')
-rw-r--r--crypto/src/asn1/cmp/PbmParameter.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/src/asn1/cmp/PbmParameter.cs b/crypto/src/asn1/cmp/PbmParameter.cs
index f4b702ed5..ae3fb5f8e 100644
--- a/crypto/src/asn1/cmp/PbmParameter.cs
+++ b/crypto/src/asn1/cmp/PbmParameter.cs
@@ -26,13 +26,16 @@ namespace Org.BouncyCastle.Asn1.Cmp
     {
         public static PbmParameter GetInstance(object obj)
         {
+            if (obj == null)
+                return null;
             if (obj is PbmParameter pbmParameter)
                 return pbmParameter;
+            return new PbmParameter(Asn1Sequence.GetInstance(obj));
+        }
 
-            if (obj != null)
-                return new PbmParameter(Asn1Sequence.GetInstance(obj));
-
-            return null;
+        public static PbmParameter GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
+        {
+            return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
         }
 
         private readonly Asn1OctetString m_salt;