Calculate is certificate good, pem file

#returns 0 if the certificate can pass another day
if openssl x509 -checkend 86400 -noout -in cert.pem; then echo 0; else echo 1; fi

#returns 0 if the certificate can pass another 10 days
if openssl x509 -checkend 864000 -noout -in cert.pem; then echo 0; else echo 1; fi

#returns 0 if the certificate can pass another 100 days
if openssl x509 -checkend 8640000 -noout -in cert.pem; then echo 0; else echo 1; fi

No comments: