# PKIXRevocationChecker

public abstract class **PKIXRevocationChecker** extends [PKIXCertPathChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html)  
A `PKIXCertPathChecker` for checking the revocation status of
certificates with the PKIX algorithm.

A `PKIXRevocationChecker` checks the revocation status of
certificates with the Online Certificate Status Protocol (OCSP) or
Certificate Revocation Lists (CRLs). OCSP is described in RFC 2560 and
is a network protocol for determining the status of a certificate. A CRL
is a time-stamped list identifying revoked certificates, and RFC 5280
describes an algorithm for determining the revocation status of certificates
using CRLs.

Each `PKIXRevocationChecker` must be able to check the revocation
status of certificates with OCSP and CRLs. By default, OCSP is the
preferred mechanism for checking revocation status, with CRLs as the
fallback mechanism. However, this preference can be switched to CRLs with
the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html#PREFER_CRLS` option. In addition, the fallback
mechanism can be disabled with the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html#NO_FALLBACK`
option.

A `PKIXRevocationChecker` is obtained by calling the
`https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidator.html#getRevocationChecker()` method
of a PKIX `CertPathValidator`. Additional parameters and options
specific to revocation can be set (by calling the
`https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOcspResponder(java.net.URI)` method for instance). The
`PKIXRevocationChecker` is added to a `PKIXParameters` object
using the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html#addCertPathChecker(java.security.cert.PKIXCertPathChecker)`
or `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html#setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>)` method,
and then the `PKIXParameters` is passed along with the `CertPath`
to be validated to the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidator.html#validate(java.security.cert.CertPath,%20java.security.cert.CertPathParameters)` method
of a PKIX `CertPathValidator`. When supplying a revocation checker in
this manner, it will be used to check revocation irrespective of the setting
of the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html#isRevocationEnabled()` flag.
Similarly, a `PKIXRevocationChecker` may be added to a
`PKIXBuilderParameters` object for use with a PKIX
`CertPathBuilder`.

Note that when a `PKIXRevocationChecker` is added to
`PKIXParameters`, it clones the `PKIXRevocationChecker`;
thus any subsequent modifications to the `PKIXRevocationChecker`
have no effect.

Any parameter that is not set (or is set to `null`) will be set to
the default value for that parameter.

**Concurrent Access**

Unless otherwise specified, the methods defined in this class are not
thread-safe. Multiple threads that need to access a single object
concurrently should synchronize amongst themselves and provide the
necessary locking. Multiple threads each manipulating separate objects
need not synchronize.

See RFC 2560: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol -
OCSP, RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation
List (CRL) Profile (Android note: this paragraph was originally in a malformed "see" tag below,
moved here for correct construction of the docs).

### Nested Class Summary

|---|---|---|---|
| enum | [PKIXRevocationChecker.Option](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html) || Various revocation options that can be specified for the revocation checking mechanism. |

### Protected Constructor Summary

|---|---|
|   | [PKIXRevocationChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#PKIXRevocationChecker())() Default constructor. |

### Public Method Summary

|---|---|
| [PKIXRevocationChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#clone())() Returns a clone of this object. |
| [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[Extension](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Extension.html)\> | [getOcspExtensions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getOcspExtensions())() Gets the optional OCSP request extensions. |
| [URI](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URI.html) | [getOcspResponder](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getOcspResponder())() Gets the URI that identifies the location of the OCSP responder. |
| [X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html) | [getOcspResponderCert](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getOcspResponderCert())() Gets the OCSP responder's certificate. |
| [Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<[X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html), byte\[\]\> | [getOcspResponses](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getOcspResponses())() Gets the OCSP responses. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[PKIXRevocationChecker.Option](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html)\> | [getOptions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getOptions())() Gets the revocation options. |
| abstract [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html)\> | [getSoftFailExceptions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#getSoftFailExceptions())() Returns a list containing the exceptions that are ignored by the revocation checker when the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html#SOFT_FAIL` option is set. |
| void | [setOcspExtensions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOcspExtensions(java.util.List<java.security.cert.Extension>))([List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[Extension](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Extension.html)\> extensions) Sets the optional OCSP request extensions. |
| void | [setOcspResponder](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOcspResponder(java.net.URI))([URI](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URI.html) uri) Sets the URI that identifies the location of the OCSP responder. |
| void | [setOcspResponderCert](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOcspResponderCert(java.security.cert.X509Certificate))([X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html) cert) Sets the OCSP responder's certificate. |
| void | [setOcspResponses](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOcspResponses(java.util.Map<java.security.cert.X509Certificate,%20byte[]>))([Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<[X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html), byte\[\]\> responses) Sets the OCSP responses. |
| void | [setOptions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html#setOptions(java.util.Set<java.security.cert.PKIXRevocationChecker.Option>))([Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[PKIXRevocationChecker.Option](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html)\> options) Sets the revocation options. |

### Inherited Method Summary

From class [java.security.cert.PKIXCertPathChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html)

|---|---|
| void | [check](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#check(java.security.cert.Certificate))([Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Certificate.html) cert) Performs the check(s) on the specified certificate using its internal state. This implementation calls `check(cert, java.util.Collections.<String>emptySet())`. |
| abstract void | [check](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#check(java.security.cert.Certificate,%20java.util.Collection<java.lang.String>))([Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Certificate.html) cert, [Collection](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> unresolvedCritExts) Performs the check(s) on the specified certificate using its internal state and removes any critical extensions that it processes from the specified collection of OID strings that represent the unresolved critical extensions. |
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#clone())() Returns a clone of this object. |
| abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [getSupportedExtensions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#getSupportedExtensions())() Returns an immutable `Set` of X.509 certificate extensions that this `PKIXCertPathChecker` supports (i.e. |
| abstract void | [init](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#init(boolean))(boolean forward) Initializes the internal state of this `PKIXCertPathChecker`. |
| abstract boolean | [isForwardCheckingSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#isForwardCheckingSupported())() Indicates if forward checking is supported. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.security.cert.CertPathChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathChecker.html)

|---|---|
| abstract void | [check](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathChecker.html#check(java.security.cert.Certificate))([Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Certificate.html) cert) Performs the check(s) on the specified certificate using its internal state. |
| abstract void | [init](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathChecker.html#init(boolean))(boolean forward) Initializes the internal state of this `CertPathChecker`. |
| abstract boolean | [isForwardCheckingSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathChecker.html#isForwardCheckingSupported())() Indicates if forward checking is supported. |

## Protected Constructors

#### protected
**PKIXRevocationChecker**
()

Default constructor.

## Public Methods

#### public [PKIXRevocationChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html)
**clone**
()

Returns a clone of this object. Calls the `Object.clone()`
method.
All subclasses which maintain state must support and
override this method, if necessary.

##### Returns

- a copy of this `PKIXCertPathChecker`

#### public [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[Extension](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Extension.html)\>
**getOcspExtensions**
()

Gets the optional OCSP request extensions.

##### Returns

- an unmodifiable list of extensions. The list is empty if no extensions have been specified.

#### public [URI](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URI.html)
**getOcspResponder**
()

Gets the URI that identifies the location of the OCSP responder. This
overrides the `ocsp.responderURL` security property. If this
parameter or the `ocsp.responderURL` property is not set, the
location is determined from the certificate's Authority Information
Access Extension, as defined in RFC 5280.

##### Returns

- the responder URI, or `null` if not set

#### public [X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html)
**getOcspResponderCert**
()

Gets the OCSP responder's certificate. This overrides the
`ocsp.responderCertSubjectName`,
`ocsp.responderCertIssuerName`,
and `ocsp.responderCertSerialNumber` security properties. If this
parameter or the aforementioned properties are not set, then the
responder's certificate is determined as specified in RFC 2560.

##### Returns

- the responder's certificate, or `null` if not set

#### public [Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<[X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html), byte\[\]\>
**getOcspResponses**
()

Gets the OCSP responses. These responses are used to determine
the revocation status of the specified certificates when OCSP is used.

##### Returns

- 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.

#### public [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[PKIXRevocationChecker.Option](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html)\>
**getOptions**
()

Gets the revocation options.

##### Returns

- an unmodifiable set of revocation options. The set is empty if no options have been specified.

#### public abstract [List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html)\>
**getSoftFailExceptions**
()

Returns a list containing the exceptions that are ignored by the
revocation checker when the `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html#SOFT_FAIL` option
is set. The list is cleared each time `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#init(boolean)` is called.
The list is ordered in ascending order according to the certificate
index returned by `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html#getIndex()`
method of each entry.


An implementation of `PKIXRevocationChecker` is responsible for
adding the ignored exceptions to the list.

##### Returns

- an unmodifiable list containing the ignored exceptions. The list is empty if no exceptions have been ignored.

#### public void
**setOcspExtensions**
([List](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/List.html)\<[Extension](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/Extension.html)\> extensions)

Sets the optional OCSP request extensions.

##### Parameters

| extensions | a list of extensions. The list is copied to protect against subsequent modification. |
|---|---|

#### public void
**setOcspResponder**
([URI](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URI.html) uri)

Sets the URI that identifies the location of the OCSP responder. This
overrides the `ocsp.responderURL` security property and any
responder specified in a certificate's Authority Information Access
Extension, as defined in RFC 5280.

##### Parameters

| uri | the responder URI |
|---|---|

#### public void
**setOcspResponderCert**
([X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html) cert)

Sets the OCSP responder's certificate. This overrides the
`ocsp.responderCertSubjectName`,
`ocsp.responderCertIssuerName`,
and `ocsp.responderCertSerialNumber` security properties.

##### Parameters

| cert | the responder's certificate |
|---|---|

#### public void
**setOcspResponses**
([Map](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Map.html)\<[X509Certificate](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/X509Certificate.html), byte\[\]\> responses)

Sets the OCSP responses. These responses are used to determine
the revocation status of the specified certificates when OCSP is used.

##### Parameters

| responses | 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. |
|---|---|

#### public void
**setOptions**
([Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[PKIXRevocationChecker.Option](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.Option.html)\> options)

Sets the revocation options.

##### Parameters

| options | a set of revocation options. The set is copied to protect against subsequent modification. |
|---|---|