summary refs log tree commit diff
path: root/crypto/src/asn1/cms
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-02-19 21:03:22 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-02-19 21:03:22 +0700
commitad0b6c99d34da50d5473a9c14837a9ce199d0200 (patch)
treefbe5e81540f15b7a3cca0401380d33bd9fbb9cc6 /crypto/src/asn1/cms
parentCase-insensitive check of boolean env. var. (diff)
downloadBouncyCastle.NET-ed25519-ad0b6c99d34da50d5473a9c14837a9ce199d0200.tar.xz
ASN.1 updates from bc-java
Diffstat (limited to 'crypto/src/asn1/cms')
-rw-r--r--crypto/src/asn1/cms/SignedData.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/src/asn1/cms/SignedData.cs b/crypto/src/asn1/cms/SignedData.cs
index dfc1e2829..5eba8390d 100644
--- a/crypto/src/asn1/cms/SignedData.cs
+++ b/crypto/src/asn1/cms/SignedData.cs
@@ -25,16 +25,13 @@ namespace Org.BouncyCastle.Asn1.Cms
         private readonly bool			certsBer;
         private readonly bool		    crlsBer;
 
-        public static SignedData GetInstance(
-            object obj)
+        public static SignedData GetInstance(object obj)
         {
             if (obj is SignedData)
-                return (SignedData) obj;
-
-            if (obj is Asn1Sequence)
-                return new SignedData((Asn1Sequence) obj);
-
-            throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj");
+                return (SignedData)obj;
+            if (obj == null)
+                return null;
+            return new SignedData(Asn1Sequence.GetInstance(obj));
         }
 
         public SignedData(