From 0888e17075876d8ce7c9556bec1986872da65200 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Thu, 1 Apr 2021 13:47:26 -0400 Subject: [PATCH] displays every cert in the trust chain in PEM file 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. --- scripts/security/show_all_cert_chains.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 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 index 00000000..1fe4125b --- /dev/null +++ b/scripts/security/show_all_cert_chains.sh @@ -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 + -- 2.34.1