summary refs log tree commit diff
path: root/crypto/src/asn1/x509/X509Extensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x509/X509Extensions.cs')
-rw-r--r--crypto/src/asn1/x509/X509Extensions.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/src/asn1/x509/X509Extensions.cs b/crypto/src/asn1/x509/X509Extensions.cs
index 390bf46b7..d4497d255 100644
--- a/crypto/src/asn1/x509/X509Extensions.cs
+++ b/crypto/src/asn1/x509/X509Extensions.cs
@@ -215,7 +215,11 @@ namespace Org.BouncyCastle.Asn1.X509
                 return new X509Extensions(sequence);
 
             if (obj is Asn1TaggedObject taggedObject)
-                return GetInstance(taggedObject.GetObject());
+            {
+                Asn1Utilities.CheckTagClass(taggedObject, Asn1Tags.ContextSpecific);
+
+                return GetInstance(taggedObject.GetBaseObject().ToAsn1Object());
+            }
 
             throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj");
         }