Created
February 26, 2015 06:08
-
-
Save uhho/481c20f093d56e1fe59c to your computer and use it in GitHub Desktop.
Extracting private key and key certificate from .pfx file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create private key (any password is ok) | |
openssl pkcs12 -in xxx.pfx -nocerts -out example.key | |
// remove password | |
openssl rsa -in example.key -out example.key | |
// generate private/public pair | |
openssl pkcs12 -in xxx.pfx -out privpub.pem | |
// get public certificate from privpub | |
openssl x509 -inform pem -in privpub.pem -pubkey -out example.crt -outform pem | |
// remove files | |
rm privpub.pem | |
rm xxxx.pfx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment