diff options
Diffstat (limited to 'crypto/src/pkcs/PrivateKeyInfoFactory.cs')
-rw-r--r-- | crypto/src/pkcs/PrivateKeyInfoFactory.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/src/pkcs/PrivateKeyInfoFactory.cs b/crypto/src/pkcs/PrivateKeyInfoFactory.cs index 1baf2dd9f..d56831f35 100644 --- a/crypto/src/pkcs/PrivateKeyInfoFactory.cs +++ b/crypto/src/pkcs/PrivateKeyInfoFactory.cs @@ -164,16 +164,16 @@ namespace Org.BouncyCastle.Pkcs else { X962Parameters x962; - if (dp is ECNamedDomainParameters _dp) - { - x962 = new X962Parameters(_dp.Name); - } - else + if (priv.PublicKeyParamSet == null) { X9ECParameters ecP = new X9ECParameters(dp.Curve, new X9ECPoint(dp.G, false), dp.N, dp.H, dp.GetSeed()); x962 = new X962Parameters(ecP); } + else + { + x962 = new X962Parameters(priv.PublicKeyParamSet); + } ec = new ECPrivateKeyStructure(orderBitLength, priv.D, publicKey, x962); |