Diff

Differences From Artifact [f51c44a744]:

To Artifact [c49efbf6f1]:


     1      1   #! /bin/bash
     2      2   
     3      3   for file in "$@"; do
     4      4   	rm -f tmpfile.x509
            5  +	if ! openssl x509 -in "${file}" -inform pem -noout -checkend 0 >/dev/null 2>/dev/null; then
            6  +		echo "warning: Skipping \"${file}\" as it is invalid or expired." >&2
            7  +
            8  +		continue
            9  +	fi
           10  +
     5     11   	openssl x509 -in "${file}" -out tmpfile.x509 -inform pem -outform der
     6     12   
     7     13   	pubkeylen="$(openssl x509 -in tmpfile.x509 -inform der -text -noout | grep 'RSA Public Key:' | sed 's@^.*(\([0-9][0-9]*\) bit).*$@\1@')"
     8     14   	certlen="$(stat -c '%s' tmpfile.x509)"
     9     15   	cert="$(( cat tmpfile.x509 | od -t x1 | cut -c 9- | tr "\n" ' '; echo ) | sed 's@ @@g;s@..@\\x&@g')"
    10     16   
    11     17   	cat << _EOF_