# PKIXCertPathChecker

public abstract class **PKIXCertPathChecker** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [CertPathChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathChecker.html) [Cloneable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Cloneable.html)

|---|---|---|
| Known Direct Subclasses [PKIXRevocationChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html) |---|---| | [PKIXRevocationChecker](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXRevocationChecker.html) | 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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html#setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>)`
or `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html#addCertPathChecker(java.security.cert.PKIXCertPathChecker)` methods
of the `PKIXParameters` and `PKIXBuilderParameters`
class. Each of the `PKIXCertPathChecker`s `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXParameters.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXBuilderParameters.html`

### Protected Constructor Summary

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

### Public Method Summary

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

### Inherited Method Summary

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
**PKIXCertPathChecker**
()

Default constructor.

## Public Methods

#### public void
**check**
([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. The certificates are presented in the order specified by the
`init` method.

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

##### Parameters

| cert | the `Certificate` to be checked |
|---|---|

##### Throws

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

#### public abstract void
**check**
([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. The certificates are presented in the order
specified by the `init` method.

##### Parameters

| cert | the `Certificate` to be checked |
| unresolvedCritExts | a `Collection` of OID strings representing the current set of unresolved critical extensions |
|---|---|

##### Throws

| [CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html) | if the specified certificate does not pass the check |
|---|---|

#### public [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.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 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**
()

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.

##### Returns

- an immutable `Set` of X.509 extension OIDs (in `String` format) supported by this `PKIXCertPathChecker`, or `null` if no extensions are supported

#### 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://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/PKIXCertPathChecker.html#check(java.security.cert.Certificate)` method
(forward or reverse). A `PKIXCertPathChecker` **must**
support reverse checking and **may** support forward checking.

##### Parameters

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

##### Throws

| [CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html) | 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 |
|---|---|

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

##### Returns

- `true` if forward checking is supported, `false` otherwise