An immutable sequence of certificates (a certification path). <p> 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.). <p> 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} cannot change in any externally visible way after being constructed. This stipulation applies to all fields and methods of this class and any added or overridden by subclasses. <p> 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}. <p> The list of {@code Certificate}s is an ordered {@code List} of zero or more {@code Certificate}s. This {@code List} and all of the {@code Certificate}s contained in it must be immutable. <p> Each {@code CertPath} object must support one or more encodings so 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. This encoding is used if no encoding is explicitly requested (for the {@link #getEncoded() getEncoded()} method, for instance). <p> All {@code CertPath} objects are also {@code Serializable}. {@code CertPath} objects are resolved into an alternate {@link CertPathRep CertPathRep} object during serialization. This allows a {@code CertPath} object to be serialized into an equivalent representation regardless of its underlying implementation. <p> {@code CertPath} objects can be created with a {@code CertificateFactory} or they can be returned by other classes, such as a {@code CertPathBuilder}. <p> 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 be included 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}.