public abstract class PKIXRevocationChecker
extends PKIXCertPathChecker
| java.lang.Object | ||
| java.security.cert.PKIXCertPathChecker | ||
| java.security.cert.PKIXRevocationChecker | ||
一个 PKIXCertPathChecker用于检查PKIX算法的证书撤销状态。
A PKIXRevocationChecker使用联机证书状态协议(OCSP)或证书撤销列表(CRL)检查证书的撤销状态。 OCSP在RFC 2560中进行了描述,是确定证书状态的网络协议。 CRL是标识撤销证书的时间戳列表,RFC 5280描述了使用CRL确定证书吊销状态的算法。
每个PKIXRevocationChecker必须能够使用OCSP和CRL检查证书的撤销状态。 默认情况下,OCSP是检查撤销状态的首选机制,CRL作为回退机制。 但是,可以使用PREFER_CRLS选项将此首选项切换到CRL。 另外,使用NO_FALLBACK选项可以禁用回退机制。
甲PKIXRevocationChecker通过调用得到getRevocationChecker一个PKIX的方法CertPathValidator 。 可以设置特定于撤销的其他参数和选项(例如,通过调用setOcspResponder方法)。 使用addCertPathChecker或setCertPathCheckers方法将PKIXRevocationChecker添加到PKIXParameters对象中,然后将PKIXParameters与CertPath一起传递,以验证PKIX CertPathValidator的validate方法。 当以这种方式提供撤销检查器时,它将用于检查撤销,而不管RevocationEnabled标志的设置如何。 同样, PKIXRevocationChecker可能会被添加到PKIXBuilderParameters对象中,以便与PKIX CertPathBuilder 。
请注意,当PKIXRevocationChecker被添加到PKIXParameters ,它会克隆PKIXRevocationChecker ; 因此对PKIXRevocationChecker任何后续修改都不起作用。
任何未设置的参数(或设置为 null )将被设置为该参数的默认值。
并发访问
除非另有说明,否则此类中定义的方法不是线程安全的。 需要同时访问单个对象的多个线程应该自己同步并提供必要的锁定。 每个操作单独对象的多个线程不需要同步。
Nested classes |
|
|---|---|
枚举 |
PKIXRevocationChecker.Option 可以为撤销检查机制指定各种撤销选项。 |
Protected constructors |
|
|---|---|
PKIXRevocationChecker() 默认的构造函数。 |
|
公共方法(Public methods) |
|
|---|---|
PKIXRevocationChecker |
clone() 返回此对象的一个克隆。 |
List<Extension> |
getOcspExtensions() 获取可选的OCSP请求扩展。 |
URI |
getOcspResponder() 获取标识OCSP响应者位置的URI。 |
X509Certificate |
getOcspResponderCert() 获取OCSP响应者的证书。 |
Map<X509Certificate, byte[]> |
getOcspResponses() 获取OCSP响应。 |
Set<PKIXRevocationChecker.Option> |
getOptions() 获取吊销选项。 |
abstract List<CertPathValidatorException> |
getSoftFailExceptions() 当设置了 |
void |
setOcspExtensions(List<Extension> extensions) 设置可选的OCSP请求扩展。 |
void |
setOcspResponder(URI uri) 设置标识OCSP响应者位置的URI。 |
void |
setOcspResponderCert(X509Certificate cert) 设置OCSP响应者的证书。 |
void |
setOcspResponses(Map<X509Certificate, byte[]> responses) 设置OCSP响应。 |
void |
setOptions(Set<PKIXRevocationChecker.Option> options) 设置吊销选项。 |
继承方法(Inherited methods) |
|
|---|---|
java.security.cert.PKIXCertPathChecker
|
|
java.lang.Object
|
|
java.security.cert.CertPathChecker
|
|
PKIXRevocationChecker clone ()
返回此对象的一个克隆。 调用Object.clone()方法。 如有必要,维护状态的所有子类必须支持并覆盖此方法。
| 返回(Returns) | |
|---|---|
PKIXRevocationChecker |
a copy of this PKIXCertPathChecker |
List<Extension> getOcspExtensions ()
获取可选的OCSP请求扩展。
| 返回(Returns) | |
|---|---|
List<Extension> |
an unmodifiable list of extensions. The list is empty if no extensions have been specified. |
URI getOcspResponder ()
获取标识OCSP响应者位置的URI。 这覆盖了ocsp.responderURL安全属性。 如果未设置此参数或ocsp.responderURL属性,则根据RFC 5280中定义的证书的Authority Information Access Extension确定位置。
| 返回(Returns) | |
|---|---|
URI |
the responder URI, or null if not set |
X509Certificate getOcspResponderCert ()
获取OCSP响应者的证书。 这将覆盖ocsp.responderCertSubjectName , ocsp.responderCertIssuerName ,并ocsp.responderCertSerialNumber安全属性。 如果未设置此参数或上述属性,则根据RFC 2560中的规定确定响应者的证书。
| 返回(Returns) | |
|---|---|
X509Certificate |
the responder's certificate, or null if not set |
Map<X509Certificate, byte[]> getOcspResponses ()
获取OCSP响应。 这些响应用于在使用OCSP时确定指定证书的撤销状态。
| 返回(Returns) | |
|---|---|
Map<X509Certificate, byte[]> |
a map of OCSP responses. Each key is an X509Certificate that maps to the corresponding DER-encoded OCSP response for that certificate. A deep copy of the map is returned to protect against subsequent modification. Returns an empty map if no responses have been specified. |
Set<PKIXRevocationChecker.Option> getOptions ()
获取吊销选项。
| 返回(Returns) | |
|---|---|
Set<PKIXRevocationChecker.Option> |
an unmodifiable set of revocation options. The set is empty if no options have been specified. |
List<CertPathValidatorException> getSoftFailExceptions ()
返回一个列表,其中包含在设置了SOFT_FAIL选项时由吊销检查器忽略的例外情况。 该列表在每次调用init清零。 该列表根据每个条目的getIndex方法返回的证书索引以升序排列。
PKIXRevocationChecker的实现负责将被忽略的异常添加到列表中。
| 返回(Returns) | |
|---|---|
List<CertPathValidatorException> |
an unmodifiable list containing the ignored exceptions. The list is empty if no exceptions have been ignored. |
void setOcspExtensions (List<Extension> extensions)
设置可选的OCSP请求扩展。
| 参数(Parameters) | |
|---|---|
extensions |
List: a list of extensions. The list is copied to protect against subsequent modification. |
void setOcspResponder (URI uri)
设置标识OCSP响应者位置的URI。 这将覆盖ocsp.responderURL安全属性以及RFC 5280中定义的证书的Authority Information Access Extension中指定的任何响应方。
| 参数(Parameters) | |
|---|---|
uri |
URI: the responder URI |
void setOcspResponderCert (X509Certificate cert)
设置OCSP响应者的证书。 这将覆盖ocsp.responderCertSubjectName , ocsp.responderCertIssuerName ,并ocsp.responderCertSerialNumber安全属性。
| 参数(Parameters) | |
|---|---|
cert |
X509Certificate: the responder's certificate |
void setOcspResponses (Map<X509Certificate, byte[]> responses)
设置OCSP响应。 这些响应用于在使用OCSP时确定指定证书的撤销状态。
| 参数(Parameters) | |
|---|---|
responses |
Map: a map of OCSP responses. Each key is an X509Certificate that maps to the corresponding DER-encoded OCSP response for that certificate. A deep copy of the map is performed to protect against subsequent modification. |
void setOptions (Set<PKIXRevocationChecker.Option> options)
设置吊销选项。
| 参数(Parameters) | |
|---|---|
options |
Set: a set of revocation options. The set is copied to protect against subsequent modification. |