Top Description Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider

pack-priv Class PKIXCertPath

extends CertPath
Class Inheritance
Imports
java.io.BufferedInputStream, .ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .InputStream, .Writer, java.security.Provider, java.security.cert.CertPath, .Certificate, .CertificateEncodingException, .CertificateException, .CertificateFactory, .X509Certificate, java.util.ArrayList, .Collections, .Enumeration, .Iterator, .List, .ListIterator, javax.security.auth.x500.X500Principal, org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1Encoding, .ASN1InputStream, .ASN1Integer, .ASN1Primitive, .ASN1Sequence, .DERSequence, .DERSet, org.bouncycastle.asn1.pkcs.ContentInfo, .PKCSObjectIdentifiers, .SignedData, org.bouncycastle.util.io.pem.PemObject, .PemWriter

CertPath implementation for X.509 certificates.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private List<E>
pack-priv static final List<E>
private final Provider

Constructor Summary

AccessConstructor and Description
pack-priv
PKIXCertPath(Provider fipsProvider, List<E> certificates)

pack-priv
PKIXCertPath(Provider fipsProvider, InputStream inStream, String encoding)

Creates a CertPath of the specified type.

Method Summary

Modifier and TypeMethod and Description
public List<E>

Returns:

an immutable List of Certificates (may be empty, but not null)
getCertificates
()

Implements abstract java.security.cert.CertPath.getCertificates.

Returns the list of certificates in this certification path.
public byte[]

Returns:

the encoded bytes
getEncoded
()

Implements abstract java.security.cert.CertPath.getEncoded.

Returns the encoded form of this certification path, using the default encoding.
public byte[]

Returns:

the encoded bytes
getEncoded
(String
the name of the encoding to use
encoding
)

Implements abstract java.security.cert.CertPath.getEncoded.

Returns the encoded form of this certification path, using the specified encoding.
public Iterator<E>

Returns:

an Iterator over the names of the supported encodings (as Strings)
getEncodings
()

Implements abstract java.security.cert.CertPath.getEncodings.

Returns an iteration of the encodings supported by this certification path, with the default encoding first.
private List<E>
sortCerts(List<E> certs)

private ASN1Primitive

Returns:

the DERObject
toASN1Object
(X509Certificate
the X509Certificate object to be encoded
cert
)

Return a DERObject containing the encoded certificate.

private byte[]
Inherited from java.security.cert.CertPath:
equalsgetTypehashCodetoStringwriteReplace

Field Detail

certificatesback to summary
private List<E> certificates
certPathEncodingsback to summary
pack-priv static final List<E> certPathEncodings
fipsProviderback to summary
private final Provider fipsProvider

Constructor Detail

PKIXCertPathback to summary
pack-priv PKIXCertPath(Provider fipsProvider, List<E> certificates)
PKIXCertPathback to summary
pack-priv PKIXCertPath(Provider fipsProvider, InputStream inStream, String encoding) throws CertificateException

Creates a CertPath of the specified type. This constructor is protected because most users should use a CertificateFactory to create CertPaths.

Method Detail

getCertificatesback to summary
public List<E> getCertificates()

Implements abstract java.security.cert.CertPath.getCertificates.

Returns the list of certificates in this certification path. The List returned must be immutable and thread-safe.

Returns:List<E>

an immutable List of Certificates (may be empty, but not null)

getEncodedback to summary
public byte[] getEncoded() throws CertificateEncodingException

Implements abstract java.security.cert.CertPath.getEncoded.

Returns the encoded form of this certification path, using the default encoding.

Returns:byte[]

the encoded bytes

Exceptions
CertificateEncodingException:
if an encoding error occurs
getEncodedback to summary
public byte[] getEncoded(String encoding) throws CertificateEncodingException

Implements abstract java.security.cert.CertPath.getEncoded.

Returns the encoded form of this certification path, using the specified encoding.

Parameters
encoding:String

the name of the encoding to use

Returns:byte[]

the encoded bytes

Exceptions
CertificateEncodingException:
if an encoding error occurs or the encoding requested is not supported
getEncodingsback to summary
public Iterator<E> getEncodings()

Implements abstract java.security.cert.CertPath.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.

Returns:Iterator<E>

an Iterator over the names of the supported encodings (as Strings)

sortCertsback to summary
private List<E> sortCerts(List<E> certs)
toASN1Objectback to summary
private ASN1Primitive toASN1Object(X509Certificate cert) throws CertificateEncodingException

Return a DERObject containing the encoded certificate.

Parameters
cert:X509Certificate

the X509Certificate object to be encoded

Returns:ASN1Primitive

the DERObject

toDEREncodedback to summary
private byte[] toDEREncoded(ASN1Encodable obj) throws CertificateEncodingException
org.bouncycastle.jcajce.provider back to summary

private Class PKIXCertPath.ByteArrayWriter

extends Writer
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteArrayOutputStream
Inherited from java.io.Writer:
lock

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Closes the stream, flushing it first.
public void
flush()

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Flushes the stream.
public void
write(char[]
Array of characters
chars
,
int
Offset from which to start writing characters
offSet
,
int
Number of characters to write
length
)

Implements abstract java.io.Writer.write.

Writes a portion of an array of characters.
Inherited from java.io.Writer:
appendappendappendnullWriterwritewritewritewrite

Field Detail

bOutback to summary
private final ByteArrayOutputStream bOut

Constructor Detail

ByteArrayWriterback to summary
pack-priv ByteArrayWriter(ByteArrayOutputStream bOut)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Doc from java.io.Writer.close.

Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
flushback to summary
public void flush() throws IOException

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Doc from java.io.Writer.flush.

Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(char[] chars, int offSet, int length) throws IOException

Implements abstract java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a portion of an array of characters.

Parameters
chars:char[]

Array of characters

offSet:int

Offset from which to start writing characters

length:int

Number of characters to write

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs