Add scripts 'get_cert_details.sh' and ' get_csr_details.sh'.
This commit is contained in:
parent
27f5d78744
commit
cf19de9ba5
@ -12,7 +12,7 @@ function usage() {
|
||||
|
||||
`basename $0` - Prints out details of the given certificate
|
||||
|
||||
usage: `basename $0` <path-to-certificate>\n"
|
||||
usage: $(basename $0) <path-to-certificate>"
|
||||
|
||||
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
|
||||
|
||||
|
36
get_csr_details.sh
Executable file
36
get_csr_details.sh
Executable 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 certification request (.csr file)
|
||||
|
||||
usage: $(basename $0) <path-to-certification-request>"
|
||||
|
||||
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 $?
|
Loading…
Reference in New Issue
Block a user