I want to encrypt the RSA PRIVATE KEY given by the piece of code:
var privateKey = cert.GetRSAPrivateKey().ExportRSAPrivateKey()
This is giving the RSA PRIVATE KEY after decrypting using openssl with command:
rsa -text -in private.key -passin pass:passphrase
Now I want a private key as in the command:
OpenSSL> pkcs12 -in src_test_resources_bokkzbv.p12 -nocerts -passin pass:yEzgzmKPkAgj6p17sHnM-des MAC verified OK Bag Attributes friendlyName: name localKeyID: <some random hex> Key Attributes: <No Attributes> Enter PEM pass phrase: passphrase Verifying - Enter PEM pass phrase: passphrase
Is there a way to do this in C# (.Net Core 3.1).
Someone please help with this.