diff options
Diffstat (limited to 'crypto/src/asn1/pkcs/SignerInfo.cs')
-rw-r--r-- | crypto/src/asn1/pkcs/SignerInfo.cs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/crypto/src/asn1/pkcs/SignerInfo.cs b/crypto/src/asn1/pkcs/SignerInfo.cs index 7abd8e5c6..777251e84 100644 --- a/crypto/src/asn1/pkcs/SignerInfo.cs +++ b/crypto/src/asn1/pkcs/SignerInfo.cs @@ -1,7 +1,4 @@ -using System; - using Org.BouncyCastle.Asn1.X509; -using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -19,21 +16,14 @@ namespace Org.BouncyCastle.Asn1.Pkcs private Asn1OctetString encryptedDigest; private Asn1Set unauthenticatedAttributes; - public static SignerInfo GetInstance( - object obj) + public static SignerInfo GetInstance(object obj) { - if (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"); - } + if (obj == null) + return null; + if (obj is SignerInfo signerInfo) + return signerInfo; + return new SignerInfo(Asn1Sequence.GetInstance(obj)); + } public SignerInfo( DerInteger version, |