You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The saved private key cannot be read by library and not correctly parsed by asn1 parsers
To Reproduce
vargenerator=GeneratorUtilities.GetKeyPairGenerator("ECGOST3410");generator.Init(newECKeyGenerationParameters(CryptoProObjectIdentifiers.GostR3410x2001CryptoProB,newSecureRandom()));vargostKeyPair=generator.GenerateKeyPair();usingvarwriter=newStringWriter();usingvarpemWriter=newPemWriter(writer);pemWriter.WriteObject(keyPair.Private);pemWriter.Writer.Flush();varpem=writer.ToString();// ^^^ Here PEM with `EC PRIVATE KEY` header, but can't correctly decoded by asn1 parsers (such as https://lapo.it/asn1js)usingvarpemReader=newPemReader(newStringReader(pem));varpemObj=pemReader.ReadObject()asAsymmetricKeyParameter;// ^^^ Here got error// Org.BouncyCastle.OpenSsl.PemException : problem creating EC private key: System.NullReferenceException: Object reference not set to an instance of an object.
Expected Behavior
Create PEM with PRIVATE KEY header (as it do openssl)
Read saved PEM back to AsymmetricKeyParameter
Product Deployment
Please complete the following information:
Version [2.5.0]
Desktop
Please complete the following information:
OS: Windows 10
Additional Context
The text was updated successfully, but these errors were encountered:
Describe the Bug
The saved private key cannot be read by library and not correctly parsed by asn1 parsers
To Reproduce
Expected Behavior
Create PEM with
PRIVATE KEY
header (as it do openssl)Read saved PEM back to AsymmetricKeyParameter
Product Deployment
Please complete the following information:
Desktop
Please complete the following information:
Additional Context
The text was updated successfully, but these errors were encountered: