Skip to content

Instantly share code, notes, and snippets.

@WillSquire
Created September 9, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillSquire/1ae095a74a064b9835e32c4c804e0033 to your computer and use it in GitHub Desktop.
Save WillSquire/1ae095a74a064b9835e32c4c804e0033 to your computer and use it in GitHub Desktop.

Requires the passcode for the .pfx file prior.

Extract .key file from .pfx file (will need to set a password here too):

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

Extract .crt file from .pfx file:

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

Extract pem formatted .key from previous .key:

openssl rsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]

Source:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment