displays every cert in the trust chain in PEM file
[feisty_meow.git] / scripts / security / show_all_cert_chains.sh
diff --git a/scripts/security/show_all_cert_chains.sh b/scripts/security/show_all_cert_chains.sh
new file mode 100644 (file)
index 0000000..1fe4125
--- /dev/null
@@ -0,0 +1,10 @@
+#!/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
+