diff options
Diffstat (limited to 'crypto/src/asn1/x509')
-rw-r--r-- | crypto/src/asn1/x509/X509Name.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/x509/X509NameEntryConverter.cs | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/crypto/src/asn1/x509/X509Name.cs b/crypto/src/asn1/x509/X509Name.cs index aa46caaac..c3c3cc6c9 100644 --- a/crypto/src/asn1/x509/X509Name.cs +++ b/crypto/src/asn1/x509/X509Name.cs @@ -928,7 +928,7 @@ namespace Org.BouncyCastle.Asn1.X509 { try { - return Asn1Object.FromByteArray(Hex.Decode(v.Substring(1))); + return Asn1Object.FromByteArray(Hex.DecodeStrict(v, 1, v.Length - 1)); } catch (IOException e) { diff --git a/crypto/src/asn1/x509/X509NameEntryConverter.cs b/crypto/src/asn1/x509/X509NameEntryConverter.cs index 5872656a9..a5a00cc59 100644 --- a/crypto/src/asn1/x509/X509NameEntryConverter.cs +++ b/crypto/src/asn1/x509/X509NameEntryConverter.cs @@ -61,9 +61,7 @@ namespace Org.BouncyCastle.Asn1.X509 string hexString, int offset) { - string str = hexString.Substring(offset); - - return Asn1Object.FromByteArray(Hex.Decode(str)); + return Asn1Object.FromByteArray(Hex.DecodeStrict(hexString, offset, hexString.Length - offset)); } /** |