summary refs log tree commit diff
path: root/crypto/src/asn1/esf/CertificateValues.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/esf/CertificateValues.cs')
-rw-r--r--crypto/src/asn1/esf/CertificateValues.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/crypto/src/asn1/esf/CertificateValues.cs b/crypto/src/asn1/esf/CertificateValues.cs
index 8329e45f8..96088209f 100644
--- a/crypto/src/asn1/esf/CertificateValues.cs
+++ b/crypto/src/asn1/esf/CertificateValues.cs
@@ -19,20 +19,19 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public static CertificateValues GetInstance(object obj)
 		{
-			if (obj == null)
-				return null;
-
-			if (obj is CertificateValues certificateValues)
-				return certificateValues;
-
-			if (obj is Asn1Sequence asn1Sequence)
-				return new CertificateValues(asn1Sequence);
-
-			throw new ArgumentException("Unknown object in 'CertificateValues' factory: " + Platform.GetTypeName(obj),
-				nameof(obj));
+            if (obj == null)
+                return null;
+            if (obj is CertificateValues certificateValues)
+                return certificateValues;
+            return new CertificateValues(Asn1Sequence.GetInstance(obj));
 		}
 
-		private CertificateValues(Asn1Sequence seq)
+        public static CertificateValues GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
+        {
+            return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+        }
+
+        private CertificateValues(Asn1Sequence seq)
 		{
 			if (seq == null)
 				throw new ArgumentNullException(nameof(seq));