bash command to grab the expiration date of a .pem file code example
Example 1: check pem expiration date
openssl x509 -enddate -noout -in file.pem
Example 2: script to get pem expiration date
$ openssl pkcs12 -in mycert.p12 -nodes | openssl x509 -noout -enddate