Skip to content

Instantly share code, notes, and snippets.

@dtaivpp
Last active March 8, 2021 21:11
Show Gist options
  • Select an option

  • Save dtaivpp/6a45b3c115e307c906f3d5fe517e4cfb to your computer and use it in GitHub Desktop.

Select an option

Save dtaivpp/6a45b3c115e307c906f3d5fe517e4cfb to your computer and use it in GitHub Desktop.
Convert a .pfx to a cert and key file
# Credit to Mark Brilman https://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
# Output Key
# pkcs12 is just .pfx
openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]
# Output Cert
openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]
# Output Decrypted Key
openssl rsa -in [keyfile-encrypted.key] -out [keyfile-decrypted.key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment