diff options
Diffstat (limited to 'crypto/src/asn1/Asn1UniversalType.cs')
-rw-r--r-- | crypto/src/asn1/Asn1UniversalType.cs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/src/asn1/Asn1UniversalType.cs b/crypto/src/asn1/Asn1UniversalType.cs index 46cacb436..81f03a540 100644 --- a/crypto/src/asn1/Asn1UniversalType.cs +++ b/crypto/src/asn1/Asn1UniversalType.cs @@ -42,10 +42,7 @@ namespace Org.BouncyCastle.Asn1 internal Asn1Object GetContextInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) { - if (Asn1Tags.ContextSpecific != taggedObject.TagClass) - throw new InvalidOperationException("this method only valid for CONTEXT_SPECIFIC tags"); - - return CheckedCast(taggedObject.GetBaseUniversal(declaredExplicit, this)); + return CheckedCast(Asn1Utilities.CheckContextTag(taggedObject).GetBaseUniversal(declaredExplicit, this)); } internal Asn1Tag Tag |