Last active
August 31, 2020 21:08
-
-
Save xen0bit/510a2b99db194403cfd2cc498e70d472 to your computer and use it in GitHub Desktop.
Openssl Bash Profile Functions
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
getcert() { | |
#Pull and parse certificate | |
echo "Q" | openssl s_client -showcerts -connect "$1":443 | openssl x509 -text | |
} | |
getcertsans() { | |
#getcertsans example.com | |
echo "Q" | openssl s_client -showcerts -connect "$1":443 | openssl x509 -text | grep "DNS:" | sed -e 's/DNS://g' | sed -e 's/, /\n/g' | sed -e 's/ //g' | |
} | |
parsecsr() { | |
openssl req -in "$1" -noout -text | |
} | |
parsecert() { | |
openssl x509 -in "$1" -text -noout | |
} | |
pfx2pem() { | |
openssl pkcs12 -in "$1" -out "$1".pem -nodes | |
} | |
der2pem() { | |
openssl x509 -inform der -in "$1" -out "$1".pem | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment