diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-04 17:32:10 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-04 17:32:10 +0700 |
commit | a610e3ed96f70969d21b57f453435d3a95bbe8ed (patch) | |
tree | b690bfd81c569f6479e4ab37d258677c8adf20c1 /crypto/src/asn1/DerObjectIdentifier.cs | |
parent | Support INTEGER encoding when reading GOST private keys (diff) | |
download | BouncyCastle.NET-ed25519-a610e3ed96f70969d21b57f453435d3a95bbe8ed.tar.xz |
Update handling of implicitly-tagged OIDs (from bc-java)
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/DerObjectIdentifier.cs | 9 |
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( |