Last active
December 16, 2022 10:24
-
-
Save acosonic/280679afc870aac08f7c86e0f17a495f to your computer and use it in GitHub Desktop.
Openssl PFX to PEM convert with chain and decyphered key usage ( ./pfx_pem_convert.sh filename)
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
#!/bin/bash | |
outfile=${1::-4} | |
echo "converting to pem with chain" | |
openssl pkcs12 -in $1 -clcerts -nokeys -out $outfile.pem | |
echo "extracting key only" | |
openssl pkcs12 -in $1 -nocerts -out tmp_wk.key | |
echo "removing passphrase from key" | |
echo openssl rsa -in tmp_wk.key -out $outfile.key | |
rm tmp_wk.key | |
echo "done, CHECK YOUR CHAINS!!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment