如何在java中提取X509Certificate的有效性? [英] How to extract Validity To and From X509Certificate in java?

查看:51
本文介绍了如何在java中提取X509Certificate的有效性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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

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

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

推荐答案

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

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

这篇关于如何在java中提取X509Certificate的有效性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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