summary refs log tree commit diff
path: root/crypto/src/asn1/cms/SignerInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/cms/SignerInfo.cs')
-rw-r--r--crypto/src/asn1/cms/SignerInfo.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/src/asn1/cms/SignerInfo.cs b/crypto/src/asn1/cms/SignerInfo.cs
index dbd0125c4..bce33e699 100644
--- a/crypto/src/asn1/cms/SignerInfo.cs
+++ b/crypto/src/asn1/cms/SignerInfo.cs
@@ -1,13 +1,24 @@
-using System;
-
 using Org.BouncyCastle.Asn1.X509;
-using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Asn1.Cms
 {
     public class SignerInfo
         : Asn1Encodable
     {
+        public static SignerInfo GetInstance(object obj)
+        {
+            if (obj == null)
+                return null;
+            if (obj is SignerInfo signerInfo)
+                return signerInfo;
+            return new SignerInfo(Asn1Sequence.GetInstance(obj));
+        }
+
+        public static SignerInfo GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
+        {
+            return new SignerInfo(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+        }
+
         private DerInteger              version;
         private SignerIdentifier        sid;
         private AlgorithmIdentifier     digAlgorithm;
@@ -16,17 +27,6 @@ namespace Org.BouncyCastle.Asn1.Cms
         private Asn1OctetString         encryptedDigest;
         private Asn1Set                 unauthenticatedAttributes;
 
-        public static SignerInfo GetInstance(object obj)
-        {
-            if (obj == null || obj is SignerInfo)
-                return (SignerInfo) obj;
-
-            if (obj is Asn1Sequence)
-                return new SignerInfo((Asn1Sequence) obj);
-
-            throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj");
-        }
-
         public SignerInfo(
             SignerIdentifier        sid,
             AlgorithmIdentifier     digAlgorithm,