diff --git a/get_cert_details.sh b/get_cert_details.sh index f1055fb..d438abd 100755 --- a/get_cert_details.sh +++ b/get_cert_details.sh @@ -12,7 +12,7 @@ function usage() { `basename $0` - Prints out details of the given certificate - usage: `basename $0` \n" + usage: $(basename $0) " EOF exit 1 @@ -27,7 +27,7 @@ while getopts h opt ; do esac done -[ $# -ne "1" ] && usage "wrong number of arguments" +[ $# -ne "1" ] && usage "Wrong number of arguments" cert_file=$1 diff --git a/get_csr_details.sh b/get_csr_details.sh new file mode 100755 index 0000000..c0e1444 --- /dev/null +++ b/get_csr_details.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + + +function usage() { + + echo + + if [ -n "$1" ];then + echo -e "Error: $1\n" + fi + cat <" + +EOF + exit 1 +} + +while getopts h opt ; do + case $opt in + h) usage + ;; + *) usage + ;; + esac +done + +[ $# -ne "1" ] && usage "Wrong number of arguments" + +csr_file=$1 + +openssl req -noout -text -in $csr_file + +exit $?