diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-26 20:57:47 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-26 20:57:47 +0700 |
commit | 2aff60a7982e1a5616172a84b8eb05c219052aef (patch) | |
tree | e0a774fed45b9b2b9f180019b26e4a8fac120ce9 /crypto/src/openssl | |
parent | Formatting (diff) | |
download | BouncyCastle.NET-ed25519-2aff60a7982e1a5616172a84b8eb05c219052aef.tar.xz |
Use custom curve if available
Diffstat (limited to 'crypto/src/openssl')
-rw-r--r-- | crypto/src/openssl/PEMReader.cs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/crypto/src/openssl/PEMReader.cs b/crypto/src/openssl/PEMReader.cs index b3a1177ce..9d3560838 100644 --- a/crypto/src/openssl/PEMReader.cs +++ b/crypto/src/openssl/PEMReader.cs @@ -12,6 +12,7 @@ using Org.BouncyCastle.Asn1.TeleTrust; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Asn1.X9; using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto.EC; using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Pkcs; @@ -382,24 +383,16 @@ namespace Org.BouncyCastle.OpenSsl string name) { // TODO ECGost3410NamedCurves support (returns ECDomainParameters though) - X9ECParameters ecP = X962NamedCurves.GetByName(name); + X9ECParameters ecP = CustomNamedCurves.GetByName(name); if (ecP == null) { - ecP = SecNamedCurves.GetByName(name); - if (ecP == null) - { - ecP = NistNamedCurves.GetByName(name); - if (ecP == null) - { - ecP = TeleTrusTNamedCurves.GetByName(name); - - if (ecP == null) - throw new Exception("unknown curve name: " + name); - } - } + ecP = ECNamedCurveTable.GetByName(name); } + if (ecP == null) + throw new Exception("unknown curve name: " + name); + //return new ECDomainParameters(ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed()); return ecP; } |