diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-01 21:07:46 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-01 21:07:46 +0700 |
commit | db9b19e3f17a2aee8afcd673ef9327bb8646b87a (patch) | |
tree | a16cf94d902be26f7f00a5218cafa15fe28cf233 /crypto/src/asn1/cmp/PopoDecKeyChallContent.cs | |
parent | Add GetInstanceFromChoice helper (diff) | |
download | BouncyCastle.NET-ed25519-db9b19e3f17a2aee8afcd673ef9327bb8646b87a.tar.xz |
Overhaul Asn1.Cmp
Diffstat (limited to 'crypto/src/asn1/cmp/PopoDecKeyChallContent.cs')
-rw-r--r-- | crypto/src/asn1/cmp/PopoDecKeyChallContent.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs b/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs index 0bd1597c8..20dadd232 100644 --- a/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs +++ b/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs @@ -7,13 +7,16 @@ namespace Org.BouncyCastle.Asn1.Cmp { public static PopoDecKeyChallContent GetInstance(object obj) { - if (obj is PopoDecKeyChallContent popoDecKeyChallContent) - return popoDecKeyChallContent; - - if (obj != null) - return new PopoDecKeyChallContent(Asn1Sequence.GetInstance(obj)); + if (obj == null) + return null; + if (obj is PopoDecKeyChallContent popoDecKeyChallContent) + return popoDecKeyChallContent; + return new PopoDecKeyChallContent(Asn1Sequence.GetInstance(obj)); + } - return null; + public static PopoDecKeyChallContent GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); } private readonly Asn1Sequence m_content; |