25 lines
353 B
Text
25 lines
353 B
Text
|
#!/bin/bash
|
||
|
|
||
|
if [[ -z $1 ]] ; then
|
||
|
echo "usage: $0 <file.crt>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
FILE=$1
|
||
|
|
||
|
if [[ ! -f $FILE ]] ; then
|
||
|
echo "File $FILE does not exist"
|
||
|
exit 2
|
||
|
fi
|
||
|
|
||
|
openssl x509 -in $FILE -noout -text | grep Subject | tr ',' "\n" | grep x500UniqueIdentifier | tr -d ' ' | cut -d '=' -f 2 -z
|
||
|
|
||
|
exit
|
||
|
\
|
||
|
|
||
|
| while read B ; do
|
||
|
#echo $B
|
||
|
printf "\x$B"
|
||
|
done
|
||
|
echo
|