Created
May 11, 2013 20:07
-
-
Save mintsoft/5561247 to your computer and use it in GitHub Desktop.
Wrapper around openssl to verify the certificate and key files match
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 | |
[[ -z "$1" || -z "$2" ]] && echo "Please specify a certificate and keyfile (in that order)" && exit 1; | |
diff -sq <(openssl x509 -noout -modulus -in "$1" | openssl md5) <(openssl rsa -noout -modulus -in "$2" | openssl md5) > /dev/null; | |
[[ $? == 0 ]] && echo "Keys Match" || echo "Keys do NOT Match"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment