37 lines
535 B
Bash
Executable File
37 lines
535 B
Bash
Executable File
#!/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 $?
|