From ad0b6c99d34da50d5473a9c14837a9ce199d0200 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 19 Feb 2020 21:03:22 +0700 Subject: ASN.1 updates from bc-java --- crypto/src/asn1/cms/SignedData.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'crypto/src/asn1/cms') 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( -- cgit 1.4.1