如何从证书生成的PEM格式的私钥中获得到期日期?

发布于 2025-02-01 17:44:09 字数 683 浏览 4 评论 0原文

嗨,我从证书中生成2个文件

  1. .pem格式,使用 openssl pkcs12 -in {{key_pair_file}}} -out {{file_name}}。pem -nocerts -nocerts -nodes -password pass:test

  2. .cer> .cer> .cer格式>格式>格式>格式>格式>格式>格式>格式>格式>格式>格式>格式>格式> ,使用openssl pkcs12 -in {{key_pair_file}} -out {{file_name}}。cer-nokeys -nodes -nodes -password pass:test

那么如何知道数字1 的到期日期? 实际上,我已经使用openssl x509 -noout -enddate {{file}}。pem命令 但是有一个错误。

...PEM routines:CRYPTO_internal:no start line:...:Expecting: TRUSTED CERTIFICATE

Hi i generate 2 file from the certificate

  1. This one in .pem format, generated using
    openssl pkcs12 -in {{key_pair_file}} -out {{file_name}}.pem -nocerts -nodes -password pass:test

  2. This one in .cer format, generated using openssl pkcs12 -in {{key_pair_file}} -out {{file_name}}.cer -nokeys -nodes -password pass:test

So how to know the expiration date of the number 1?
actually I already use openssl x509 -noout -enddate {{file}}.pem command
but got an error.

...PEM routines:CRYPTO_internal:no start line:...:Expecting: TRUSTED CERTIFICATE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘羡 2025-02-08 17:44:09

钥匙没有任何固有的到期概念。只有证书才能。

Keys don't have any inherent notion of expiration. Only certificates do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文