diff options
Diffstat (limited to 'crypto/src/asn1/cmp/ProtectedPart.cs')
-rw-r--r-- | crypto/src/asn1/cmp/ProtectedPart.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/src/asn1/cmp/ProtectedPart.cs b/crypto/src/asn1/cmp/ProtectedPart.cs index fc83ac6c6..863a85e17 100644 --- a/crypto/src/asn1/cmp/ProtectedPart.cs +++ b/crypto/src/asn1/cmp/ProtectedPart.cs @@ -5,13 +5,16 @@ namespace Org.BouncyCastle.Asn1.Cmp { public static ProtectedPart GetInstance(object obj) { - if (obj is ProtectedPart protectedPart) - return protectedPart; - - if (obj != null) - return new ProtectedPart(Asn1Sequence.GetInstance(obj)); + if (obj == null) + return null; + if (obj is ProtectedPart popoDecKeyRespContent) + return popoDecKeyRespContent; + return new ProtectedPart(Asn1Sequence.GetInstance(obj)); + } - return null; + public static ProtectedPart GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); } private readonly PkiHeader m_header; |