如何从 PEM 编码证书中确定 SSL 证书到期日期? [英] How to determine SSL cert expiration date from a PEM encoded certificate?

查看:61
本文介绍了如何从 PEM 编码证书中确定 SSL 证书到期日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 Mac 或 Linux 中有实际文件和 Bash shell,我如何查询证书文件何时到期?不是网站,而是证书文件本身,假设我有 csr、key、pem 和链文件.

If I have the actual file and a Bash shell in Mac or Linux, how can I query the cert file for when it will expire? Not a web site, but actually the certificate file itself, assuming I have the csr, key, pem and chain files.

推荐答案

With openssl:

openssl x509 -enddate -noout -in file.pem

输出在表单上:

notAfter=Nov  3 22:23:50 2014 GMT

另请参阅 MikeW 的回答,了解如何轻松检查证书是否已过期,或者它是否会在特定时间段,无需解析上述日期.

Also see MikeW's answer for how to easily check whether the certificate has expired or not, or whether it will within a certain time period, without having to parse the date above.

这篇关于如何从 PEM 编码证书中确定 SSL 证书到期日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆