version 1.40.130 release
[feisty_meow.git] / scripts / security / show_all_cert_chains.sh
1 #!/bin/bash
2
3 # displays every certificate in a PEM file that has a whole certificate chain.
4 # this is surprisingly annoying to get anything to output, so we codified it.
5
6 # by chris koeritz
7
8 file="$1"; shift
9 if [ -z "$file" -o ! -f "$file" ]; then
10   echo This script requires a PEM-format file name to show the certificates within.
11   exit 1
12 fi
13
14 openssl crl2pkcs7 -nocrl -certfile "$file" | openssl pkcs7 -print_certs -text -noout
15