Unable to cast object of type 'Org.BouncyCastle.Asn1.DerSequence' to type 'Org.BouncyCastle.Asn1.DerInteger'
in my c # project, I put this piece of code : initially, I recovered from the certificate that I created with bouncy castle, the key pair, then I extract the private key, my goal is that , it is in a format. pem, AsymmetricKeyParameter private_RSA = keyPair2.Private; PrivateKeyInfo k_RSA = PrivateKeyInfoFactory.CreatePrivateKeyInfo(private_RSA); byte[] serializedKey_priv_RSA = k_RSA.ToAsn1Object().GetDerEncoded(); // byte[] clé = Org.BouncyCastle.Utilities.Encoders.Hex.Decode(serializedKey); string data_priv_RSA = Convert.ToBase64String(serializedKey_priv_RSA); using (fluxInfos2 = new StreamWr
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.