diff --git a/get_cert_details.sh b/get_cert_details.sh new file mode 100755 index 0000000..f1055fb --- /dev/null +++ b/get_cert_details.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + + +function usage() { + + echo + + if [ -n "$1" ];then + echo -e "Error: $1\n" + fi + cat <\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 $?