Skip to content

Instantly share code, notes, and snippets.

@RVIRUS0817

RVIRUS0817/diffcsrkey.sh

Last active Nov 16, 2016
Embed
What would you like to do?
shell script
#!/bin/bash
while getopts c:k: opt
do
case ${opt} in
c)
CERTFILE=${OPTARG};;
k)
KEYFILE=${OPTARG};;
*)
exit 1;;
esac
done
CERT=`/usr/bin/openssl x509 -in $CERTFILE -modulus -noout > CRT.txt`
KEY=`/usr/bin/openssl rsa -in $KEYFILE -modulus -noout > KEY.txt`
result=diff $CERT $KEY
if [ "$result" = "" ];then
echo ""
else
echo ""
fi
rm CRT.txt KEY.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment