|
||||||||||
| 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(java.io.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. |
java.lang.String |
toString()
Returns a string giving some information about the contents of this NetscapeCertList object. |
void |
writeTo(java.io.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(java.io.InputStream is)
throws java.io.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 read| Method Detail |
public X509Certificate[] getCertificateList()
NetscapeCertList
object, as array of X509Certificatespublic void setCertificateList(X509Certificate[] certificateList)
certificateList - the chain of certificates as array
public void writeTo(java.io.OutputStream os)
throws java.io.IOException
os - the output stream to which the certificate chain shall
be written
public byte[] toByteArray()
throws PKCSException
NetscapeCertList object as DER encoded byte array.
NetscapeCertList object as DER encoded byte arraypublic java.lang.String toString()
NetscapeCertList object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||