Add script 'get_cert_details.sh'.

This commit is contained in:
Christoph 2017-08-04 14:09:17 +02:00
parent 1abb3129d8
commit 27f5d78744

36
get_cert_details.sh Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
function usage() {
echo
if [ -n "$1" ];then
echo -e "Error: $1\n"
fi
cat <<EOF
`basename $0` - Prints out details of the given certificate
usage: `basename $0` <path-to-certificate>\n"
EOF
exit 1
}
while getopts h opt ; do
case $opt in
h) usage
;;
*) usage
;;
esac
done
[ $# -ne "1" ] && usage "wrong number of arguments"
cert_file=$1
openssl x509 -noout -text -in $cert_file
exit $?