View Javadoc
1 /* 2 * Title: S/MIME Project 3 * Description: S/MIME email sending capabilities 4 * @Author Vladimir Radisic 5 * @Version 2.0.1 6 */ 7 8 9 package org.webdocwf.util.smime.cms; 10 11 12 import org.webdocwf.util.smime.exception.SMIMEException; 13 import org.webdocwf.util.smime.exception.ErrorStorage; 14 import org.webdocwf.util.smime.der.DERClassContextSpecificPr; 15 import java.security.cert.X509Certificate; 16 17 18 /*** 19 * Certificates class is DER encoded container, represented in ASN.1 notation 20 * according to RFC2630, for storing X509 certificates or for storing certificates 21 * chain in CMS object of signed message.<BR> 22 * <BR> 23 * certificates [0] IMPLICIT CertificateSet OPTIONAL<BR> 24 */ 25 public class Certificates extends DERClassContextSpecificPr { 26 27 /*** 28 * Constructs structured DER encoded object with tag Class Context Specific 29 * @exception SMIMEException thrown from super class constructor. 30 */ 31 public Certificates() throws SMIMEException { 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 cert0) throws SMIMEException { 43 try { 44 super.addContent(cert0.getEncoded()); 45 } catch (Exception e) { 46 throw SMIMEException.getInstance(this, e, "addCertificate"); 47 } 48 } 49 } 50

This page was automatically generated by Maven