|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.pkcs.NetscapeCertList
This class implements the Netscape Certificate Sequence format.
Netscape uses its own format for disseminating certificate lists, based on a PKCS#7 ContentInfo. The contentType object identifer is netscape-cert-sequence (2.16.840.1.113730.2.5) and the content simply is a sequence of certificates:
CertificateSequence ::= SEQUENCE OF CertificateFor creating a certificate list to be sent just use the empty default constructor and subsequently supply the certificates as array of
X509Certificate
instances. Finally write
the Netscape certificate list DER encoded to a stream, call method
writeTo
, e.g.:
X509Certificate[] certs = ...; NetscapeCertList netscapeCertList = new NetscapeCertList(); netscapeCertList.setCertificateList(certs); OutputStream os = ...; netscapeCertList.writeTo(os);For parsing a DER encoded Netscape Cert List use theor:
NetscapeCertList pkcs7 = new NetscapeCertList(new FileInputStream("certs.p7c")); X509Certificate[] certs = pkcs7.getCertificateList();
NetscapeCertList(InputStream)
constructor:
// the DER encoded Netscape cert list supplied from a stream: InputStream is = ...; NetscapeCertList netscapeCertList = new NetscapeCertList(is); X509Certificate[] certs = netscapeCertList.getCertificateList();
X509Certificate
Constructor Summary | |
NetscapeCertList()
Default constructor. |
|
NetscapeCertList(InputStream is)
Creates a NetscapeCertList from an input stream.
|
Method Summary | |
X509Certificate[] |
getCertificateList()
Returns the certificates included in this NetscapeCertList object. |
void |
setCertificateList(X509Certificate[] certificateList)
Set the certificates for this NetscapeCertList object. |
byte[] |
toByteArray()
Returns this NetscapeCertList object as DER encoded byte array.
|
String |
toString()
Returns a string giving some information about the contents of this NetscapeCertList object. |
void |
writeTo(OutputStream os)
Writes this Netscape certificate chain DER encoded to the given output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NetscapeCertList()
NetscapeCertList
object.
Use setCertificateList
for supplying a list of X509Certificates, e.g.:
NetscapeCertList netscapeCertList = new NetscapeCertList(); netscapeCertList.setCertificateList(certs);
public NetscapeCertList(InputStream is) throws IOException, PKCSParsingException
NetscapeCertList
from an input stream.
You may use this constructor for "reading in" a certificate list that
has been written to a stream using the
writeTo
method, e.g.:
NetscapeCertList netscapeCertList = new NetscapeCertList(...); X509Certificate[] certs = netscapeCertList.getCertificateList();
is
- the input stream from where the object shall be readIOException
- if the object could not be readPKCSParsingException
- if the object could not be parsedMethod Detail |
public X509Certificate[] getCertificateList()
NetscapeCertList
object, as array of X509Certificatespublic void setCertificateList(X509Certificate[] certificateList)
certificateList
- the chain of certificates as arraypublic void writeTo(OutputStream os) throws IOException
os
- the output stream to which the certificate chain shall
be writtenIOException
- if an error occurs during writing out the streampublic byte[] toByteArray() throws PKCSException
NetscapeCertList
object as DER encoded byte array.
NetscapeCertList
object as DER encoded byte arrayPKCSException
- if an encoding error occurspublic String toString()
NetscapeCertList
object.toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |