Created
November 14, 2012 14:23
-
-
Save ozeias/4072382 to your computer and use it in GitHub Desktop.
Converting SSL-certificates from CRT format to PEM
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 | |
for f in $(file *.crt|grep data|sed 's/: *data//') | |
do | |
echo "Processing $f file to ${f/.crt/.pem}..." | |
openssl x509 -in $f -inform der -outform pem -out ${f/.crt/.pem} | |
rm $f | |
done | |
# openssl x509 -in serprov2.crt -out serprov2.der -outform DER | |
# openssl x509 -in serprov2.der -inform der -outform pem -out serprov2.pem | |
for f in *.crt | |
do | |
echo "Processing $f file to ${f/.crt/.pem}..." | |
openssl x509 -in $f -out ${f/.crt/.der} -outform DER | |
openssl x509 -in ${f/.crt/.der} -inform der -outform pem -out ${f/.crt/.pem} | |
rm $f | |
rm ${f/.crt/.der} | |
done | |
# Find broken symlinks and delete them | |
# find -L . -type l -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment