summary refs log tree commit diff
path: root/crypto/src/asn1/DerObjectIdentifier.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/DerObjectIdentifier.cs')
-rw-r--r--crypto/src/asn1/DerObjectIdentifier.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/src/asn1/DerObjectIdentifier.cs b/crypto/src/asn1/DerObjectIdentifier.cs
index 6ac2b7e9e..495260a68 100644
--- a/crypto/src/asn1/DerObjectIdentifier.cs
+++ b/crypto/src/asn1/DerObjectIdentifier.cs
@@ -42,7 +42,14 @@ namespace Org.BouncyCastle.Asn1
             Asn1TaggedObject	obj,
             bool				explicitly)
         {
-            return GetInstance(obj.GetObject());
+            Asn1Object o = obj.GetObject();
+
+            if (explicitly || o is DerObjectIdentifier)
+            {
+                return GetInstance(o);
+            }
+
+            return FromOctetString(Asn1OctetString.GetInstance(o).GetOctets());
         }
 
         public DerObjectIdentifier(