Created
July 12, 2018 15:02
-
-
Save jstrassburg/07161ea6e798a3059ec7d549852f159d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
usage() { | |
echo "Usage: $0 /path/to/thing.pfx" | |
exit -1 | |
} | |
if [ "$#" -lt 1 ]; then | |
usage | |
fi | |
PFX=$(basename -- "$1") | |
FILENAME="${PFX%.*}" | |
PEM="$FILENAME.pem" | |
KEY="$FILENAME.key" | |
CERT="$FILENAME.crt" | |
openssl pkcs12 -in $PFX -out $PEM -nodes | |
openssl rsa -in $PEM -out $KEY | |
openssl x509 -in $PEM -out $CERT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment