Last active
October 24, 2016 07:21
-
-
Save mintsoft/5561156 to your computer and use it in GitHub Desktop.
Wrapper around openssl for converting pkcs12 certificates exported out of IIS into unencrypted x509 for Apache
This file contains 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
#!/bin/bash | |
[[ -z "$1" ]] && echo "Please specify a .pfx file!" && exit 1; | |
#combined format: | |
openssl pkcs12 -in "$1" -out "${1%.pfx}.key_cert.pem" -nodes | |
#extract certificate/public key | |
openssl x509 -in "${1%.pfx}.key_cert.pem" -out "${1%.pfx}.cert" | |
#extract private key | |
openssl rsa -in "${1%.pfx}.key_cert.pem" -out "${1%.pfx}.key" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment