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

# PKIXCertPathChecker

` public abstract class PKIXCertPathChecker `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/security/cert/CertPathChecker, https://developer.android.com/reference/java/lang/Cloneable `

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

Known direct subclasses [PKIXRevocationChecker](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker) [PKIXRevocationChecker](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker) A `PKIXCertPathChecker` for checking the revocation status of certificates with the PKIX algorithm.   

*** ** * ** ***

An abstract class that performs one or more checks on an `X509Certificate`.

A concrete implementation of the `PKIXCertPathChecker` class can be created to extend the PKIX certification path validation algorithm. For example, an implementation may check for and process a critical private extension of each certificate in a certification path.

Instances of `PKIXCertPathChecker` are passed as parameters using the `https://developer.android.com/reference/java/security/cert/PKIXParameters#setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>)` or `https://developer.android.com/reference/java/security/cert/PKIXParameters#addCertPathChecker(java.security.cert.PKIXCertPathChecker)` methods of the `PKIXParameters` and `PKIXBuilderParameters` class. Each of the `PKIXCertPathChecker`s `https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#check(java.security.cert.Certificate)` methods will be called, in turn, for each certificate processed by a PKIX `CertPathValidator` or `CertPathBuilder` implementation.

A `PKIXCertPathChecker` may be called multiple times on successive certificates in a certification path. Concrete subclasses are expected to maintain any internal state that may be necessary to check successive certificates. The `https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#init(boolean)` method is used to initialize the internal state of the checker so that the certificates of a new certification path may be checked. A stateful implementation **must** override the `https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#clone()` method if necessary in order to allow a PKIX `CertPathBuilder` to efficiently backtrack and try other paths. In these situations, the `CertPathBuilder` is able to restore prior path validation states by restoring the cloned `PKIXCertPathChecker`s.

The order in which the certificates are presented to the `PKIXCertPathChecker` may be either in the forward direction (from target to most-trusted CA) or in the reverse direction (from most-trusted CA to target). A `PKIXCertPathChecker` implementation **must** support reverse checking (the ability to perform its checks when it is presented with certificates in the reverse direction) and **may** support forward checking (the ability to perform its checks when it is presented with certificates in the forward direction). The `https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#isForwardCheckingSupported()` method indicates whether forward checking is supported.

Additional input parameters required for executing the check may be specified through constructors of concrete implementations of this class.

**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 also:**

- `https://developer.android.com/reference/java/security/cert/PKIXParameters`
- `https://developer.android.com/reference/java/security/cert/PKIXBuilderParameters`

## Summary

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

| ### Public methods ||
|---|---|
| ` 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. |

### Inherited methods

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

### PKIXCertPathChecker

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

```
protected PKIXCertPathChecker ()
```

Default constructor.

<br />

## Public methods

### check

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

```
public void check (Certificate cert)
```

Performs the check(s) on the specified certificate using its internal state. The certificates are presented in the order specified by the `init` method.

This implementation calls `check(cert, java.util.Collections.<String>emptySet())`.

<br />

| Parameters ||
|---|---|
| `cert` | `Certificate`: the `Certificate` to be checked <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/CertPathValidatorException` |   |

### check

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

```
public abstract void check (Certificate cert, 
                Collection<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. The certificates are presented in the order specified by the `init` method.

<br />

| Parameters ||
|---|---|
| `cert` | `Certificate`: the `Certificate` to be checked <br /> |
| `unresolvedCritExts` | `Collection`: a `Collection` of OID strings representing the current set of unresolved critical extensions <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/CertPathValidatorException` | if the specified certificate does not pass the check |

### clone

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

```
public Object 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/lang/Object` | a copy of this `PKIXCertPathChecker` <br /> |

### getSupportedExtensions

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

```
public abstract Set<String> getSupportedExtensions ()
```

Returns an immutable `Set` of X.509 certificate extensions that this `PKIXCertPathChecker` supports (i.e. recognizes, is able to process), or `null` if no extensions are supported.

Each element of the set is a `String` representing the Object Identifier (OID) of the X.509 extension that is supported. The OID is represented by a set of nonnegative integers separated by periods.

All X.509 certificate extensions that a `PKIXCertPathChecker` might possibly be able to process should be included in the set.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/String>` | an immutable `Set` of X.509 extension OIDs (in `String` format) supported by this `PKIXCertPathChecker`, or `null` if no extensions are supported <br /> |

### init

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

```
public abstract void init (boolean forward)
```

Initializes the internal state of this `PKIXCertPathChecker`.

The `forward` flag specifies the order that certificates will be passed to the `https://developer.android.com/reference/java/security/cert/PKIXCertPathChecker#check(java.security.cert.Certificate)` method (forward or reverse). A `PKIXCertPathChecker` **must** support reverse checking and **may** support forward checking.

<br />

| Parameters ||
|---|---|
| `forward` | `boolean`: the order that certificates are presented to the `check` method. If `true`, certificates are presented from target to most-trusted CA (forward); if `false`, from most-trusted CA to target (reverse). <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/CertPathValidatorException` | if this `PKIXCertPathChecker` is unable to check certificates in the specified order; it should never be thrown if the forward flag is false since reverse checking must be supported |

### isForwardCheckingSupported

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

```
public abstract boolean isForwardCheckingSupported ()
```

Indicates if forward checking is supported. Forward checking refers to the ability of the `PKIXCertPathChecker` to perform its checks when certificates are presented to the `check` method in the forward direction (from target to most-trusted CA).

<br />

| Returns ||
|---|---|
| `boolean` | `true` if forward checking is supported, `false` otherwise <br /> |