本文介绍了java apis用于证书吊销检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Java支持OCSP开箱即用。

正在执行的方式(我的意思是撤销检查)对程序员来说是透明的。

我的问题是,有没有任何api(java的一部分),可以创建一个有效的OCSP请求或响应?因此,程序员可以实现一个自定义的OCSP检查器?


Java supports OCSP out of the box.
The way it is being done though, (I mean the revocation check) is transparent to the programmer.
My question is, is there any api (part of java) that can create a valid OCSP request or response? So that it would be possible for a programmer to implement a custom OCSP checker?

推荐答案

标准Java API不提供公开可用的类来处理OCSP。在Sun / Oracle的JDK中,OCSP管理类位于 sun.security.provider.certpath 包中(即,Java规范之外的包) code> public (所以你不能使用它们,而不使用反射,给自己扩展访问权限后)。

The standard Java API does not provide publicly available classes to handle OCSP. In Sun/Oracle's JDK, the OCSP management classes are in the sun.security.provider.certpath package (i.e. a package which is outside of the Java specification) and are not public (so you cannot use them without resorting to reflection, after giving yourself extended access rights).

Sun / Oracle的JDK中的实现是一个纯客户端:它可以对请求和解码响应进行编码,但不能解码请求或编码响应。

Also, the implementation in Sun/Oracle's JDK is a pure client: it can encode requests and decode responses, but it cannot decode requests or encode responses.

因此,实现自定义OCSP检查器需要手动实现编码和解码机制:它可以做到,但不是在五行代码。 是一个完全用Java编写的开源PKI,其中包括对OCSP的一些支持(我不知道是否提取包含在另一个应用程序中的OCSP代码很容易或不容易)。

Hence, implementing a custom OCSP checker would entail implementing the encoding and decoding mechanisms manually: it can be done, but not in five lines of code. EJBCA is an opensource PKI, entirely written in Java, which includes some support for OCSP (I do not know whether extracting the OCSP code for inclusion in another application would be easy or not).

这篇关于java apis用于证书吊销检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 13:26