This is an abstract class that defines the methods common to all {@code CertPath}s. Subclasses can handle different kinds of certificates (X.509, PGP, etc.).
All {@code CertPath} objects have a type, a list of{@code Certificate}s, and one or more supported encodings. Because the {@code CertPath} class is immutable, a {@code CertPath} cannotchange in any externally visible way after being constructed. This stipulation applies to all public fields and methods of this class and any added or overridden by subclasses.
The type is a {@code String} that identifies the type of{@code Certificate}s in the certification path. For each certificate {@code cert} in a certification path {@code certPath}, {@code cert.getType().equals(certPath.getType())} must be{@code true}.
The list of {@code Certificate}s is an ordered {@code List} ofzero or more {@code Certificate}s. This {@code List} and allof the {@code Certificate}s contained in it must be immutable.
Each {@code CertPath} object must support one or more encodingsso that the object can be translated into a byte array for storage or transmission to other parties. Preferably, these encodings should be well-documented standards (such as PKCS#7). One of the encodings supported by a {@code CertPath} is considered the default encoding. Thisencoding is used if no encoding is explicitly requested (for the {@link #getEncoded() getEncoded()} method, for instance).
All {@code CertPath} objects are also {@code Serializable}. {@code CertPath} objects are resolved into an alternate{@link CertPathRep CertPathRep} object during serialization. This allowsa {@code CertPath} object to be serialized into an equivalentrepresentation regardless of its underlying implementation.
{@code CertPath} objects can be created with a{@code CertificateFactory} or they can be returned by other classes,such as a {@code CertPathBuilder}.
By convention, X.509 {@code CertPath}s (consisting of {@code X509Certificate}s), are ordered starting with the target certificate and ending with a certificate issued by the trust anchor. That is, the issuer of one certificate is the subject of the following one. The certificate representing the {@link TrustAnchor TrustAnchor} should not beincluded in the certification path. Unvalidated X.509 {@code CertPath}s may not follow these conventions. PKIX {@code CertPathValidator}s will detect any departure from these conventions that cause the certification path to be invalid and throw a {@code CertPathValidatorException}.
Every implementation of the Java platform is required to support the following standard {@code CertPath} encodings:
Concurrent Access
All {@code CertPath} objects must be thread-safe. That is, multiplethreads may concurrently invoke the methods defined in this class on a single {@code CertPath} object (or more than one) with noill effects. This is also true for the {@code List} returned by{@code CertPath.getCertificates}.
Requiring {@code CertPath} objects to be immutable and thread-safeallows them to be passed around to various pieces of code without worrying about coordinating access. Providing this thread-safety is generally not difficult, since the {@code CertPath} and{@code List} objects in question are immutable. @see CertificateFactory @see CertPathBuilder @author Yassir Elley @since 1.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|