supposedly can take a PEM file with the trust chain components (i.e.
certificates) in any order, since one cannot count on the order they are
found in. have not tested this, but it did display well for the one
file i needed to see all the certs in.
--- /dev/null
+#!/bin/bash
+
+file="$1"; shift
+if [ -z "$file" -o ! -f "$file" ]; then
+ echo This script requires a PEM-format file name to show the certificates within.
+ exit 1
+fi
+
+openssl crl2pkcs7 -nocrl -certfile "$file" | openssl pkcs7 -print_certs -text -noout
+