Currently, I can extract the private key from the PFX file using OpenSSL using the following commands:
openssl pkcs12 -in filename.pfx -nocerts -out privateKey.pem
openssl.exe rsa -in privateKey.pem -out private.pem
The private.pem file starts with ---BEGIN RSA PRIVATE KEY---and ends with---END RSA PRIVATE KEY---
I want to do the same in C # using the .NET libraries or the Bouncy Castle library.
How to do it?
Subbu source
share