Class sun.security.ssl.CertChain
All Packages Class Hierarchy This Package Previous Next Index
Class sun.security.ssl.CertChain
java.lang.Object
|
+----sun.security.ssl.CertChain
- public class CertChain
- extends Object
Represents a chain of X.509 certificates, with the self-signed certificate
for a "root" CA at the end. Basic policy validation has been done on these
chains, when instances of this class get constructed. Revalidation may be
done at any time.
NOTE: This class will probably be augmented by a more
general superclass, which has no knowledge of SSL.
-
CertChain(byte[])
- Construct a cert chain from an array of data, in the form
that toBytes() returns.
-
CertChain(X509Cert[])
- Builds a CertChain out of an ordered array of certificates.
-
getSubjectName()
- Returns the name of this subject.
-
getX509CertChain()
- Returns the ordered chain of X.509 certificates.
-
print(PrintStream)
- Prints the certificate chain for informative purposes.
-
revalidate()
- Perform the policy based chain validation tests right now.
-
toBytes()
- Return an encoded version of the certificate chain.
-
toString()
- Summarizes the cert chain.
CertChain
public CertChain(X509Cert certs[]) throws CertException
- Builds a CertChain out of an ordered array of certificates.
All of the certificates must be currently valid, as must
the order within the chain.
- Parameters:
- certs - the certificate chain, with the root CA at
the end.
- Throws: CertException
- if certificates in the chain
are invalid, the chain is not well constructed,
or if cert chain security policies are not met.
CertChain
public CertChain(byte data[]) throws IOException, CertException
- Construct a cert chain from an array of data, in the form
that toBytes() returns.
revalidate
public void revalidate() throws CertException
- Perform the policy based chain validation tests right now.
These were made initially when the chain was accepted, but
as time passes a chain may become invalid due to leaving
the validity period of a certificate, revocations, the local
trust policy changing, or for other reasons.
NOTE: As of this writing, there is
no useful trust policy implemented. The certificates are
only validated as to validity and signature consistency.
Accordingly, you should not yet make security decisions based
on whether the certificate chain is validated.
- Throws: CertException
- if certificates in the chain
are invalid, the chain is not well constructed,
or if trust policies are not satisfied.
getSubjectName
public String getSubjectName()
- Returns the name of this subject.
toString
public String toString()
- Summarizes the cert chain.
- Overrides:
- toString in class Object
toBytes
public byte[] toBytes()
- Return an encoded version of the certificate chain. The certs are
encoded from subject to root, with each certificate preceded by a
twenty-four bit "length" field (in big endian form).
print
public void print(PrintStream p) throws IOException
- Prints the certificate chain for informative purposes.
getX509CertChain
public X509Cert[] getX509CertChain()
- Returns the ordered chain of X.509 certificates.
All Packages Class Hierarchy This Package Previous Next Index