java - 客户端证书上的 OCSP 吊销

标签 java security tomcat x509certificate ocsp

我如何使用 OCSP 在 java 中手动检查证书吊销状态,只给定客户端的 java.security.cert.X509Certificate?我看不到一个明确的方法。

或者,我可以让 tomcat 自动为我做这件事吗?你怎么知道你的解决方案是正确的?

最佳答案

我找到了一个最优秀的解决方案:

http://www.docjar.com/html/api/sun/security/provider/certpath/OCSP.java.html

        /**
   54    * This is a class that checks the revocation status of a certificate(s) using
   55    * OCSP. It is not a PKIXCertPathChecker and therefore can be used outside of
   56    * the CertPathValidator framework. It is useful when you want to
   57    * just check the revocation status of a certificate, and you don't want to
   58    * incur the overhead of validating all of the certificates in the
   59    * associated certificate chain.
   60    *
   61    * @author Sean Mullan
   62    */

它有一个方法 check(X509Certificate clientCert, X509Certificate issuerCert) 可以解决问题!

关于java - 客户端证书上的 OCSP 吊销,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5161504/

相关文章:

security - gpg2中gpg-agent的目的

java - 获取 HTTP 状态 404 -/访问 URL http ://localhost:8080/in Tomcat? 时出现错误消息

java - 如果联接关系位于 EmbeddedId 上,如何使用 Criteria API 联接两个表

java - 关于做大量计算的三个问题

java - 替换时如何保存 fragment 内容?

java - Eclipse 3.5.1 使用大量内存

apache - 提供 403 禁止错误的特别敏感的 Mod 安全规则

security - 防止 session 劫持的最佳方法是什么?

java - 在 Tomcat 中使用系统类加载器加载类

tomcat - 使用tomcat将请求和 header 转发到不同的主机