Package java.security.cert
Class CertPath
java.lang.Object
java.security.cert.CertPath
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OpenSSLX509CertPath,PKIXCertPath,X509CertPathImpl
public abstract class CertPath extends Object implements Serializable
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:
Certificate, Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classCertPath.CertPathRepThe alternateSerializableclass to be used for serialization and deserialization onCertPathobjects. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(Object other)ReturnstrueifCertificates 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 theCertificates contained in theCertPath.abstract byte[]getEncoded()Returns an encoding of theCertPathusing the default encoding.abstract byte[]getEncoded(String encoding)abstract Iterator<String>getEncodings()Returns anIteratorover the supported encodings for a representation of the certificate path.StringgetType()Returns the type ofCertificatein this instance.inthashCode()OverridesObject.hashCode().StringtoString()Returns aStringrepresentation of thisCertPathinstance.protected ObjectwriteReplace()Returns an alternate object to be serialized.
-
Constructor Details
-
CertPath
Creates a newCertPathinstance for the specified certificate type.- Parameters:
type- the certificate type.
-
-
Method Details
-
getType
Returns the type ofCertificatein this instance.- Returns:
- the certificate type.
-
equals
ReturnstrueifCertificates in the list are the same type and the lists are equal (and by implication the certificates contained within are the same).- Overrides:
equalsin classObject- Parameters:
other-CertPathto be compared for equality.- Returns:
trueif the object are equal,falseotherwise.- See Also:
Object.hashCode()
-
hashCode
public int hashCode()OverridesObject.hashCode(). The function is defined as follows:hashCode = 31 * path.getType().hashCode() + path.getCertificates().hashCode();- Overrides:
hashCodein classObject- Returns:
- the hash code for this instance.
- See Also:
Object.equals(java.lang.Object)
-
toString
Returns aStringrepresentation of thisCertPathinstance. It is the result of callingtoStringon allCertificates in theList. -
getCertificates
Returns an immutable List of theCertificates contained in theCertPath.- Returns:
- a list of
Certificates in theCertPath.
-
getEncoded
Returns an encoding of theCertPathusing the default encoding.- Returns:
- default encoding of the
CertPath. - Throws:
CertificateEncodingException- if the encoding fails.
-
getEncoded
- Throws:
CertificateEncodingException- if the encoding fails.
-
getEncodings
Returns anIteratorover the supported encodings for a representation of the certificate path.- Returns:
Iteratorover supported encodings (asStrings).
-
writeReplace
Returns an alternate object to be serialized.- Returns:
- an alternate object to be serialized.
- Throws:
ObjectStreamException- if the creation of the alternate object fails.
-