#!/bin/bash if [[ -z $1 ]] ; then echo "usage: $0 " 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