summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/x509/X509Name.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/asn1/x509/X509Name.cs b/crypto/src/asn1/x509/X509Name.cs
index 8fd564090..6135ad2fa 100644
--- a/crypto/src/asn1/x509/X509Name.cs
+++ b/crypto/src/asn1/x509/X509Name.cs
@@ -532,11 +532,11 @@ namespace Org.BouncyCastle.Asn1.X509
             if (name.StartsWith("OID.", StringComparison.OrdinalIgnoreCase))
                 return new DerObjectIdentifier(name.Substring("OID.".Length));
 
-            if (name[0] >= '0' && name[0] <= '9')
-                return new DerObjectIdentifier(name);
-
-            if (lookup.TryGetValue(name, out var oid))
+            if (DerObjectIdentifier.TryFromID(name, out var oid) ||
+                lookup.TryGetValue(name, out oid))
+            {
                 return oid;
+            }
 
             throw new ArgumentException("Unknown object id - " + name + " - passed to distinguished name");
         }