summary refs log tree commit diff
path: root/crypto/src/asn1/esf/CertificateValues.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-04 02:17:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-04 02:17:04 +0700
commit7610f647360313aa86d89884c45ce6d334876b73 (patch)
treeb01a0b682c5064cae4b5e1f075089410edfbfdbe /crypto/src/asn1/esf/CertificateValues.cs
parentUpdate IPAddress from bc-java (diff)
downloadBouncyCastle.NET-ed25519-7610f647360313aa86d89884c45ce6d334876b73.tar.xz
Misc. refactoring after bc-fips-csharp updates
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));