KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > oyster > cms > Certificates


1 /*
2  * Title: Oyster Project
3  * Description: S/MIME email sending capabilities
4  * @Author Vladimir Radisic
5  * @Version 2.1.5
6  */

7
8
9 package org.enhydra.oyster.cms;
10
11 import org.enhydra.oyster.exception.SMIMEException;
12 import org.enhydra.oyster.exception.ErrorStorage;
13 import org.enhydra.oyster.der.DERClassContextSpecificPr;
14 import java.security.cert.X509Certificate JavaDoc;
15
16
17 /**
18  * Certificates class is DER encoded container, represented in ASN.1 notation
19  * according to RFC2630, for storing X509 certificates or for storing certificates
20  * chain in CMS object of signed message.<BR>
21  * <BR>
22  * certificates [0] IMPLICIT CertificateSet OPTIONAL<BR>
23  */

24 public class Certificates extends DERClassContextSpecificPr {
25
26 /**
27  * Constructs structured DER encoded object with tag Class Context Specific
28  * @exception SMIMEException thrown from super class constructor.
29  */

30   public Certificates () throws SMIMEException
31   {
32     super(0, true);
33   }
34
35 /**
36  * Adds X509 Certificate
37  * @param cert0 X509Certificate
38  * @exception SMIMEException caused by non SMIMEException which is:
39  * CertificateEncodingException. Also, it can be thrown from super class
40  * addContent method.
41  */

42   public void addCertificate (X509Certificate JavaDoc cert0) throws SMIMEException {
43     try {
44       super.addContent(cert0.getEncoded());
45     }
46     catch(Exception JavaDoc e) {
47       throw SMIMEException.getInstance(this, e, "addCertificate" );
48     }
49   }
50 }
51
52
53
54
Popular Tags