diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-13 20:56:44 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-13 20:56:44 +0700 |
commit | ce8a94ae634fd0a7d8ce60443f8834608d42c919 (patch) | |
tree | 42c06401426d561e4fc984debbe0ae810277905b /crypto/src/asn1/DerObjectIdentifier.cs | |
parent | Update release notes (diff) | |
download | BouncyCastle.NET-ed25519-ce8a94ae634fd0a7d8ce60443f8834608d42c919.tar.xz |
ASN.1 updates from bc-java
Diffstat (limited to 'crypto/src/asn1/DerObjectIdentifier.cs')
-rw-r--r-- | crypto/src/asn1/DerObjectIdentifier.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/src/asn1/DerObjectIdentifier.cs b/crypto/src/asn1/DerObjectIdentifier.cs index fb38d5f05..9a0571b57 100644 --- a/crypto/src/asn1/DerObjectIdentifier.cs +++ b/crypto/src/asn1/DerObjectIdentifier.cs @@ -24,8 +24,18 @@ namespace Org.BouncyCastle.Asn1 { if (obj == null || obj is DerObjectIdentifier) return (DerObjectIdentifier) obj; + + if (obj is Asn1Encodable) + { + Asn1Object asn1Obj = ((Asn1Encodable)obj).ToAsn1Object(); + + if (asn1Obj is DerObjectIdentifier) + return (DerObjectIdentifier)asn1Obj; + } + if (obj is byte[]) return FromOctetString((byte[])obj); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } |