Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Protected Ctors](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker#proctors) \| [Methods](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker#inhmethods)

# PKIXRevocationChecker

` public abstract class PKIXRevocationChecker `   
` ` ` extends https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [java.security.cert.PKIXCertPathChecker](https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker) ||
|   | ↳ | java.security.cert.PKIXRevocationChecker |

<br />

*** ** * ** ***

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://developer.android.com/reference/java/security/cert/PKIXRevocationChecker.Option#PREFER_CRLS` option. In addition, the fallback mechanism can be disabled with the `https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker.Option#NO_FALLBACK` option.

A `PKIXRevocationChecker` is obtained by calling the `https://developer.android.com/reference/java/security/cert/CertPathValidator#getRevocationChecker()` method of a PKIX `CertPathValidator`. Additional parameters and options specific to revocation can be set (by calling the `https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker#setOcspResponder(java.net.URI)` method for instance). The `PKIXRevocationChecker` is added to a `PKIXParameters` object using the `https://developer.android.com/reference/java/security/cert/PKIXParameters#addCertPathChecker(java.security.cert.PKIXCertPathChecker)` or `https://developer.android.com/reference/java/security/cert/PKIXParameters#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://developer.android.com/reference/java/security/cert/CertPathValidator#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://developer.android.com/reference/java/security/cert/PKIXParameters#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.

## Summary

| ### Protected constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker#PKIXRevocationChecker()() ` Default constructor. |

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

### Inherited methods

From class ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker ` ` void` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#check(java.security.cert.Certificate)(https://developer.android.com/reference/java/security/cert/Certificate 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` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#check(java.security.cert.Certificate,%20java.util.Collection<java.lang.String>)(https://developer.android.com/reference/java/security/cert/Certificate cert, https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String> 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.
` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#clone()() `

Returns a clone of this object.
` abstract https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/String>` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#getSupportedExtensions()() `

Returns an immutable `Set` of X.509 certificate extensions that this `PKIXCertPathChecker` supports (i.e.
` abstract void` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#init(boolean)(boolean forward) `

Initializes the internal state of this `PKIXCertPathChecker`.
` abstract boolean` ` https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#isForwardCheckingSupported()() `

Indicates if forward checking is supported.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/java/security/cert/CertPathChecker ` ` abstract void` ` https://developer.android.com/reference/java/security/cert/CertPathChecker#check(java.security.cert.Certificate)(https://developer.android.com/reference/java/security/cert/Certificate cert) `

Performs the check(s) on the specified certificate using its internal state.
` abstract void` ` https://developer.android.com/reference/java/security/cert/CertPathChecker#init(boolean)(boolean forward) `

Initializes the internal state of this `CertPathChecker`.
` abstract boolean` ` https://developer.android.com/reference/java/security/cert/CertPathChecker#isForwardCheckingSupported()() `

Indicates if forward checking is supported.

## Protected constructors

### PKIXRevocationChecker

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected PKIXRevocationChecker ()
```

Default constructor.

<br />

## Public methods

### clone

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PKIXRevocationChecker 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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker` | a copy of this `PKIXCertPathChecker` <br /> |

### getOcspExtensions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Extension> getOcspExtensions ()
```

Gets the optional OCSP request extensions.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/Extension>` | an unmodifiable list of extensions. The list is empty if no extensions have been specified. <br /> |

### getOcspResponder

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public URI 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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/URI` | the responder URI, or `null` if not set <br /> |

### getOcspResponderCert

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public X509Certificate 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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/X509Certificate` | the responder's certificate, or `null` if not set <br /> |

### getOcspResponses

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Map<X509Certificate, byte[]> getOcspResponses ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/java/security/cert/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. <br /> |

### getOptions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<PKIXRevocationChecker.Option> getOptions ()
```

Gets the revocation options.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker.Option>` | an unmodifiable set of revocation options. The set is empty if no options have been specified. <br /> |

### getSoftFailExceptions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract List<CertPathValidatorException> getSoftFailExceptions ()
```

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

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/CertPathValidatorException>` | an unmodifiable list containing the ignored exceptions. The list is empty if no exceptions have been ignored. <br /> |

### setOcspExtensions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOcspExtensions (List<Extension> extensions)
```

Sets the optional OCSP request extensions.

<br />

| Parameters ||
|---|---|
| `extensions` | `List`: a list of extensions. The list is copied to protect against subsequent modification. <br /> |

### setOcspResponder

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOcspResponder (URI 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.

<br />

| Parameters ||
|---|---|
| `uri` | `URI`: the responder URI <br /> |

### setOcspResponderCert

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOcspResponderCert (X509Certificate cert)
```

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

<br />

| Parameters ||
|---|---|
| `cert` | `X509Certificate`: the responder's certificate <br /> |

### setOcspResponses

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOcspResponses (Map<X509Certificate, byte[]> responses)
```

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

<br />

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

### setOptions

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOptions (Set<PKIXRevocationChecker.Option> options)
```

Sets the revocation options.

<br />

| Parameters ||
|---|---|
| `options` | `Set`: a set of revocation options. The set is copied to protect against subsequent modification. <br /> |