Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public abstract class

CertPath

extends Object
implements Serializable
java.lang.Object
   ↳ java.security.cert.CertPath

Class Overview

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 Certificate s 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 Certificate s 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.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected CertPath ( String type)

Added in API level 1

Creates a new CertPath instance for the specified certificate type.

Parameters
type the certificate type.

Public Methods

public boolean equals ( Object other)

Added in API level 1

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

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

public abstract List <? extends  Certificate > getCertificates ()

Added in API level 1

Returns an immutable List of the Certificate s contained in the CertPath .

Returns
  • a list of Certificate s in the CertPath .

public abstract byte[] getEncoded ( String encoding)

Added in API level 1

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

Throws
CertificateEncodingException if the encoding fails.

public abstract byte[] getEncoded ()

Added in API level 1

Returns an encoding of the CertPath using the default encoding.

Returns
  • default encoding of the CertPath .
Throws
CertificateEncodingException if the encoding fails.

public abstract Iterator < String > getEncodings ()

Added in API level 1

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

Returns
  • Iterator over supported encodings (as String s).

public String getType ()

Added in API level 1

Returns the type of Certificate in this instance.

Returns
  • the certificate type.

public int hashCode ()

Added in API level 1

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

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

Returns
  • the hash code for this instance.

public String toString ()

Added in API level 1

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

Returns
  • a string representation of this instance.

Protected Methods

protected Object writeReplace ()

Added in API level 1

Returns an alternate object to be serialized.

Returns
  • an alternate object to be serialized.
Throws
ObjectStreamException if the creation of the alternate object fails.