Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CertPath

public abstract class CertPath
extends Object implements Serializable

java.lang.Object
   ↳ java.security.cert.CertPath


An immutable certificate path that can be validated. All certificates in the path are of the same type (i.e., X509).

A CertPath can be represented as a byte array in at least one supported encoding scheme (i.e. PkiPath or PKCS7) when serialized.

When a List of the certificates is obtained it must be immutable.

A CertPath must be thread-safe without requiring coordinated access.

See also:

Summary

Nested classes

class CertPath.CertPathRep

The alternate Serializable class to be used for serialization and deserialization on CertPath objects. 

Protected constructors

CertPath(String type)

Creates a new CertPath instance for the specified certificate type.

Public methods

boolean equals(Object other)

Returns true if Certificates in the list are the same type and the lists are equal (and by implication the certificates contained within are the same).

abstract List<? extends Certificate> getCertificates()

Returns an immutable List of the Certificates contained in the CertPath.

abstract byte[] getEncoded(String encoding)

Returns an encoding of this CertPath using the given encoding from getEncodings().

abstract byte[] getEncoded()

Returns an encoding of the CertPath using the default encoding.

abstract Iterator<String> getEncodings()

Returns an Iterator over the supported encodings for a representation of the certificate path.

String getType()

Returns the type of Certificate in this instance.

int hashCode()

Overrides Object.hashCode().

String toString()

Returns a String representation of this CertPath instance.

Protected methods

Object writeReplace()

Returns an alternate object to be serialized.

Inherited methods

From class java.lang.Object

Protected constructors

CertPath

Added in API level 1
CertPath (String type)

Creates a new CertPath instance for the specified certificate type.

Parameters
type String: the certificate type.

Public methods

equals

Added in API level 1
boolean equals (Object other)

Returns true if Certificates in the list are the same type and the lists are equal (and by implication the certificates contained within are the same).

Parameters
other Object: CertPath to be compared for equality.
Returns
boolean true if the object are equal, false otherwise.

getCertificates

Added in API level 1
List<? extends Certificate> getCertificates ()

Returns an immutable List of the Certificates contained in the CertPath.

Returns
List<? extends Certificate> a list of Certificates in the CertPath.

getEncoded

Added in API level 1
byte[] getEncoded (String encoding)

Returns an encoding of this CertPath using the given encoding from getEncodings().

Parameters
encoding String
Returns
byte[]
Throws
CertificateEncodingException if the encoding fails.

getEncoded

Added in API level 1
byte[] getEncoded ()

Returns an encoding of the CertPath using the default encoding.

Returns
byte[] default encoding of the CertPath.
Throws
CertificateEncodingException if the encoding fails.

getEncodings

Added in API level 1
Iterator<String> getEncodings ()

Returns an Iterator over the supported encodings for a representation of the certificate path.

Returns
Iterator<String> Iterator over supported encodings (as Strings).

getType

Added in API level 1
String getType ()

Returns the type of Certificate in this instance.

Returns
String the certificate type.

hashCode

Added in API level 1
int hashCode ()

Overrides Object.hashCode(). The function is defined as follows:

 hashCode = 31 * path.getType().hashCode() +
 path.getCertificates().hashCode();
 

Returns
int the hash code for this instance.

toString

Added in API level 1
String toString ()

Returns a String representation of this CertPath instance. It is the result of calling toString on all Certificates in the List.

Returns
String a string representation of this instance.

Protected methods

writeReplace

Added in API level 1
Object writeReplace ()

Returns an alternate object to be serialized.

Returns
Object an alternate object to be serialized.
Throws
ObjectStreamException if the creation of the alternate object fails.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.