如何在java中提取X509Certificate的有效性?

发布于 2025-01-03 20:26:13 字数 163 浏览 1 评论 0原文

我可以使用 checkValidility() 方法检查 X509Certificate 证书的有效性,但我的项目要求还从 X509Certificate 日期中提取日期和日期的有效性并存储在数据库中。

但 API 中没有返回这些日期的方法。

所以,请帮助我提取这些值。提前致谢。

I am able to check for the validity of the X509Certificate certificate using the checkValidility() method, But my project requirement is also to extract validity to and from dates also from the X509Certificate date and store in the database.

But there are no methods in the API which returns these dates.

So, please help me in extracting these values. Thanks in Advance.

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

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

发布评论

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

评论(2

孤芳又自赏 2025-01-10 20:26:13

有API方法。 X509Certificate getNotBefore() getNotAfter()方法应该返回这些日期。

There are API methods. The X509Certificate getNotBefore() and getNotAfter() methods should return those dates.

随风而去 2025-01-10 20:26:13

我找到了问题的答案,API 确实提供了返回这些日期的方法:

x509Certificate.getNotAfter() - 验证日期。

x509Certificate.getNotBefore() - 在日期之前验证。

I found the answer for my Question , API does provide methods to return these dates:

x509Certificate.getNotAfter() - Validate To Date.

x509Certificate.getNotBefore() - Validate Before Date.

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