public class X509CertPath extends 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.
CertPath.CertPathRep| Constructor and Description |
|---|
X509CertPath(InputStream is)
Creates an
X509CertPath, reading the encoded form
from an InputStream. |
X509CertPath(InputStream is,
String encoding)
Creates an
X509CertPath, reading the encoded form
from an InputStream. |
X509CertPath(List certs)
Creates an
X509CertPath from a List of
X509Certificates. |
| Modifier and Type | Method and Description |
|---|---|
List<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(String encoding)
Returns the encoded form of this certification path, using the
specified encoding.
|
Iterator<String> |
getEncodings()
Returns an iteration of the encodings supported by this certification
path, with the default encoding first.
|
static Iterator<String> |
getEncodingsStatic()
Returns the encodings supported by this certification path, with the
default encoding first.
|
public X509CertPath(List certs) throws CertificateException
X509CertPath from a List of
X509Certificates.
The certificates are copied out of the supplied List
object.
certs - a List of X509CertificatesCertificateException - if certs contains an element
that is not an X509Certificatepublic X509CertPath(InputStream is) throws 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 fromCertificateException - if an exception occurs while decodingpublic X509CertPath(InputStream is, String encoding) throws 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 usedCertificateException - if an exception occurs while decoding or
the encoding requested is not supportedpublic byte[] getEncoded() throws CertificateEncodingException
getEncoded in class CertPathCertificateEncodingException - if an encoding error occurspublic byte[] getEncoded(String encoding) throws CertificateEncodingException
getEncoded in class CertPathencoding - the name of the encoding to useCertificateEncodingException - if an encoding error occurs or
the encoding requested is not supportedpublic static Iterator<String> getEncodingsStatic()
Iterator over the names of the supported
encodings (as Strings)public Iterator<String> getEncodings()
Attempts to modify the returned Iterator via its
remove method result in an
UnsupportedOperationException.
getEncodings in class CertPathIterator over the names of the supported
encodings (as Strings)public List<X509Certificate> getCertificates()
List returned must be immutable and thread-safe.getCertificates in class CertPathList of X509Certificates
(may be empty, but not null)