public class X509CertPath
extends java.security.cert.CertPath
CertPath (certification path)
consisting exclusively of
X509Certificates.
By convention, X.509 CertPaths are stored from target
to trust anchor.
That is, the issuer of one certificate is the subject of the following
one. However, unvalidated X.509 CertPaths may not follow
this convention. PKIX CertPathValidators will detect any
departure from this convention and throw a
CertPathValidatorException.
| Constructor and Description |
|---|
X509CertPath(java.io.InputStream is)
Creates an
X509CertPath, reading the encoded form
from an InputStream. |
X509CertPath(java.io.InputStream is,
java.lang.String encoding)
Creates an
X509CertPath, reading the encoded form
from an InputStream. |
X509CertPath(java.util.List<? extends java.security.cert.Certificate> certs)
Creates an
X509CertPath from a List of
X509Certificates. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.security.cert.X509Certificate> |
getCertificates()
Returns the list of certificates in this certification path.
|
byte[] |
getEncoded()
Returns the encoded form of this certification path, using the
default encoding.
|
byte[] |
getEncoded(java.lang.String encoding)
Returns the encoded form of this certification path, using the
specified encoding.
|
java.util.Iterator<java.lang.String> |
getEncodings()
Returns an iteration of the encodings supported by this certification
path, with the default encoding first.
|
static java.util.Iterator<java.lang.String> |
getEncodingsStatic()
Returns the encodings supported by this certification path, with the
default encoding first.
|
public X509CertPath(java.util.List<? extends java.security.cert.Certificate> certs)
throws java.security.cert.CertificateException
X509CertPath from a List of
X509Certificates.
The certificates are copied out of the supplied List
object.
certs - a List of X509Certificatesjava.security.cert.CertificateException - if certs contains an element
that is not an X509Certificatepublic X509CertPath(java.io.InputStream is)
throws java.security.cert.CertificateException
X509CertPath, reading the encoded form
from an InputStream. The data is assumed to be in
the default encoding.is - the InputStream to read the data fromjava.security.cert.CertificateException - if an exception occurs while decodingpublic X509CertPath(java.io.InputStream is,
java.lang.String encoding)
throws java.security.cert.CertificateException
X509CertPath, reading the encoded form
from an InputStream. The data is assumed to be in the specified
encoding.is - the InputStream to read the data fromencoding - the encoding usedjava.security.cert.CertificateException - if an exception occurs while decoding or
the encoding requested is not supportedpublic byte[] getEncoded()
throws java.security.cert.CertificateEncodingException
getEncoded in class java.security.cert.CertPathjava.security.cert.CertificateEncodingException - if an encoding error occurspublic byte[] getEncoded(java.lang.String encoding)
throws java.security.cert.CertificateEncodingException
getEncoded in class java.security.cert.CertPathencoding - the name of the encoding to usejava.security.cert.CertificateEncodingException - if an encoding error occurs or
the encoding requested is not supportedpublic static java.util.Iterator<java.lang.String> getEncodingsStatic()
Iterator over the names of the supported
encodings (as Strings)public java.util.Iterator<java.lang.String> getEncodings()
Attempts to modify the returned Iterator via its
remove method result in an
UnsupportedOperationException.
getEncodings in class java.security.cert.CertPathIterator over the names of the supported
encodings (as Strings)public java.util.List<java.security.cert.X509Certificate> getCertificates()
List returned must be immutable and thread-safe.getCertificates in class java.security.cert.CertPathList of X509Certificates
(may be empty, but not null)