org.bouncycastle.jce.provider
Class PKIXCertPath

java.lang.Object
  extended by java.security.cert.CertPath
      extended by org.bouncycastle.jce.provider.PKIXCertPath
All Implemented Interfaces:
java.io.Serializable

public class PKIXCertPath
extends java.security.cert.CertPath

CertPath implementation for X.509 certificates.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.security.cert.CertPath
java.security.cert.CertPath.CertPathRep
 
Field Summary
private  java.util.List certificates
           
(package private) static java.util.List certPathEncodings
           
 
Constructor Summary
PKIXCertPath(java.io.InputStream inStream, java.lang.String encoding)
          Creates a CertPath of the specified type.
PKIXCertPath(java.util.List certificates)
           
 
Method Summary
 java.util.List 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 getEncodings()
          Returns an iteration of the encodings supported by this certification path, with the default encoding first.
private  java.util.List sortCerts(java.util.List certs)
           
private  DERObject toASN1Object(java.security.cert.X509Certificate cert)
          Return a DERObject containing the encoded certificate.
private  byte[] toDEREncoded(ASN1Encodable obj)
           
 
Methods inherited from class java.security.cert.CertPath
equals, getType, hashCode, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

certPathEncodings

static final java.util.List certPathEncodings

certificates

private java.util.List certificates
Constructor Detail

PKIXCertPath

PKIXCertPath(java.util.List certificates)

PKIXCertPath

PKIXCertPath(java.io.InputStream inStream,
             java.lang.String encoding)
       throws java.security.cert.CertificateException
Creates a CertPath of the specified type. This constructor is protected because most users should use a CertificateFactory to create CertPaths.

Throws:
java.security.cert.CertificateException
Method Detail

sortCerts

private java.util.List sortCerts(java.util.List certs)
Parameters:
certs -

getEncodings

public java.util.Iterator getEncodings()
Returns an iteration of the encodings supported by this certification path, with the default encoding first. Attempts to modify the returned Iterator via its remove method result in an UnsupportedOperationException.

Specified by:
getEncodings in class java.security.cert.CertPath
Returns:
an Iterator over the names of the supported encodings (as Strings)

getEncoded

public byte[] getEncoded()
                  throws java.security.cert.CertificateEncodingException
Returns the encoded form of this certification path, using the default encoding.

Specified by:
getEncoded in class java.security.cert.CertPath
Returns:
the encoded bytes
Throws:
java.security.cert.CertificateEncodingException - if an encoding error occurs

getEncoded

public byte[] getEncoded(java.lang.String encoding)
                  throws java.security.cert.CertificateEncodingException
Returns the encoded form of this certification path, using the specified encoding.

Specified by:
getEncoded in class java.security.cert.CertPath
Parameters:
encoding - the name of the encoding to use
Returns:
the encoded bytes
Throws:
java.security.cert.CertificateEncodingException - if an encoding error occurs or the encoding requested is not supported

getCertificates

public java.util.List getCertificates()
Returns the list of certificates in this certification path. The List returned must be immutable and thread-safe.

Specified by:
getCertificates in class java.security.cert.CertPath
Returns:
an immutable List of Certificates (may be empty, but not null)

toASN1Object

private DERObject toASN1Object(java.security.cert.X509Certificate cert)
                        throws java.security.cert.CertificateEncodingException
Return a DERObject containing the encoded certificate.

Parameters:
cert - the X509Certificate object to be encoded
Returns:
the DERObject
Throws:
java.security.cert.CertificateEncodingException

toDEREncoded

private byte[] toDEREncoded(ASN1Encodable obj)
                     throws java.security.cert.CertificateEncodingException
Throws:
java.security.cert.CertificateEncodingException