Last active
March 22, 2018 17:56
-
-
Save 4ndrej/72b6e9423e2c63ce4e129ce0997feda3 to your computer and use it in GitHub Desktop.
pfx to key/cer chain
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
# convert from pfx to passwordless key/crt chain | |
# based on https://gist.github.com/ericharth/8334664 | |
# params | |
PFX="hostname.pfx" | |
PASSWORD="pfxpassword" | |
OUT="hostname-2018" | |
# key | |
openssl pkcs12 -in $PFX -password pass:$PASSWORD -nodes -nocerts -out $OUT.key | |
# crt | |
openssl pkcs12 -in $PFX -password pass:$PASSWORD -nodes -nokeys -clcerts -out host.crt | |
openssl pkcs12 -in $PFX -password pass:$PASSWORD -nodes -nokeys -cacerts -out ca.crt | |
cat host.crt ca.crt > $OUT.crt | |
rm host.crt ca.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment