declare namespace java { namespace security { namespace cert { /** * An immutable sequence of certificates (a certification path). *

* 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} cannot * change 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} of * zero or more {@code Certificate}s. This {@code List} and all * of the {@code Certificate}s contained in it must be immutable. *

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

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

* {@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 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}. *

Every implementation of the Java platform is required to support the * following standard {@code CertPath} encodings: *

* These encodings are described in the * CertPath Encodings section of the * Java Cryptography Architecture Standard Algorithm Name Documentation. * Consult the release documentation for your implementation to see if any * other encodings are supported. *

* Concurrent Access *

* All {@code CertPath} objects must be thread-safe. That is, multiple * threads may concurrently invoke the methods defined in this class on a * single {@code CertPath} object (or more than one) with no * ill effects. This is also true for the {@code List} returned by * {@code CertPath.getCertificates}. *

* Requiring {@code CertPath} objects to be immutable and thread-safe * allows 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 */ // @ts-ignore abstract class CertPath extends java.lang.Object implements java.io.Serializable { /** * Creates a {@code CertPath} of the specified type. *

* This constructor is protected because most users should use a * {@code CertificateFactory} to create {@code CertPath}s. * @param type the standard name of the type of * {#code Certificate}s in this path */ // @ts-ignore constructor(type: java.lang.String | string) /** * Returns the type of {@code Certificate}s in this certification * path. This is the same string that would be returned by * {@link java.security.cert.Certificate#getType() cert.getType()} * for all {@code Certificate}s in the certification path. * @return the type of {#code Certificate}s in this certification * path (never null) */ // @ts-ignore public getType(): string /** * Returns an iteration of the encodings supported by this certification * path, with the default encoding first. Attempts to modify the returned * {@code Iterator} via its {@code remove} method result in an * {@code UnsupportedOperationException}. * @return an {#code Iterator} over the names of the supported * encodings (as Strings) */ // @ts-ignore public abstract getEncodings(): java.util.Iterator /** * Compares this certification path for equality with the specified * object. Two {@code CertPath}s are equal if and only if their * types are equal and their certificate {@code List}s (and by * implication the {@code Certificate}s in those {@code List}s) * are equal. A {@code CertPath} is never equal to an object that is * not a {@code CertPath}. *

* This algorithm is implemented by this method. If it is overridden, * the behavior specified here must be maintained. * @param other the object to test for equality with this certification path * @return true if the specified object is equal to this certification path, * false otherwise */ // @ts-ignore public equals(other: java.lang.Object | any): boolean /** * Returns the hashcode for this certification path. The hash code of * a certification path is defined to be the result of the following * calculation: *

{@code
                 * hashCode = path.getType().hashCode();
                 * hashCode = 31*hashCode + path.getCertificates().hashCode();
                 * }
* This ensures that {@code path1.equals(path2)} implies that * {@code path1.hashCode()==path2.hashCode()} for any two certification * paths, {@code path1} and {@code path2}, as required by the * general contract of {@code Object.hashCode}. * @return the hashcode value for this certification path */ // @ts-ignore public hashCode(): number /*int*/ /** * Returns a string representation of this certification path. * This calls the {@code toString} method on each of the * {@code Certificate}s in the path. * @return a string representation of this certification path */ // @ts-ignore public toString(): string /** * Returns the encoded form of this certification path, using the default * encoding. * @return the encoded bytes * @exception CertificateEncodingException if an encoding error occurs */ // @ts-ignore public abstract getEncoded(): number /*byte*/[] /** * Returns the encoded form of this certification path, using the * specified encoding. * @param encoding the name of the encoding to use * @return the encoded bytes * @exception CertificateEncodingException if an encoding error occurs or * the encoding requested is not supported */ // @ts-ignore public abstract getEncoded(encoding: java.lang.String | string): number /*byte*/[] /** * Returns the list of certificates in this certification path. * The {@code List} returned must be immutable and thread-safe. * @return an immutable {#code List} of {@code Certificate}s * (may be empty, but not null) */ // @ts-ignore public abstract getCertificates(): Array /** * Replaces the {@code CertPath} to be serialized with a * {@code CertPathRep} object. * @return the {#code CertPathRep} to be serialized * @throws ObjectStreamException if a {#code CertPathRep} object * representing this certification path could not be created */ // @ts-ignore writeReplace(): any } } } }