public abstract class CertPath extends Object implements Serializable
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.
Certificate
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
CertPath.CertPathRep
The alternate
Serializable class to be used for serialization and
deserialization on CertPath objects. |
Modifier | Constructor and Description |
---|---|
protected |
CertPath(String type)
Creates a new
CertPath instance for the specified certificate
type. |
Modifier and Type | Method and Description |
---|---|
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()
Returns an encoding of the
CertPath using the default encoding. |
abstract byte[] |
getEncoded(String encoding)
Returns an encoding of the
CertPath using the specified 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 Object |
writeReplace()
Returns an alternate object to be serialized.
|
protected CertPath(String type)
CertPath
instance for the specified certificate
type.type
- the certificate type.public String getType()
Certificate
in this instance.public boolean equals(Object other)
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).equals
in class Object
other
- CertPath
to be compared for equality.true
if the object are equal, false
otherwise.Object.hashCode()
public int hashCode()
Object.hashCode()
. The function is defined as follows:
hashCode = 31 * path.getType().hashCode() +
path.getCertificates().hashCode();
hashCode
in class Object
Object.equals(java.lang.Object)
public String toString()
String
representation of this CertPath
instance. It is the result of calling toString
on all Certificate
s in the List
.public abstract List<? extends Certificate> getCertificates()
Certificate
s contained
in the CertPath
.Certificate
s in the CertPath
.public abstract byte[] getEncoded() throws CertificateEncodingException
CertPath
using the default encoding.CertPath
.CertificateEncodingException
- if the encoding fails.public abstract byte[] getEncoded(String encoding) throws CertificateEncodingException
CertPath
using the specified encoding.encoding
- encoding that should be generated.CertPath
.CertificateEncodingException
- if the encoding fails.public abstract Iterator<String> getEncodings()
Iterator
over the supported encodings for a
representation of the certificate path.Iterator
over supported encodings (as String
s).protected Object writeReplace() throws ObjectStreamException
ObjectStreamException
- if the creation of the alternate object fails.