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.der;
10
11
12 import java.io.UnsupportedEncodingException;
13 import org.webdocwf.util.smime.exception.SMIMEException;
14 import org.webdocwf.util.smime.exception.ErrorStorage;
15
16
17 /***
18 * DERIA5String is primitive type of DER encoded object for one of
19 * different forms for representing character string type in ASN.1 notation.
20 */
21 public class DERIA5String extends DERObject {
22
23 /***
24 * Constructs DERIA5String object with characters defined in the given
25 * String
26 * @param s0 content of DERIA5String
27 * @exception SMIMEException thrown in super class constructor. Also, it can be
28 * caused by non SMIMEException which is: UnsupportedEncodingException.
29 */
30 public DERIA5String(String s0) throws SMIMEException {
31 super(22);
32 byte[] temp = null;
33
34 try {
35 temp = s0.getBytes("ISO-8859-1");
36 } catch (Exception e) {
37 throw SMIMEException.getInstance(this, e, "constructor");
38 }
39 this.addContent(temp);
40 }
41
42 /***
43 * Constructs DERIA5String object with characters defined in the given
44 * byte array
45 * @param b0 content of DERIA5String
46 * @exception SMIMEException thrown in super class constructor.
47 */
48 public DERIA5String(byte[] b0) throws SMIMEException {
49 super(22);
50 this.addContent(b0);
51 }
52 }
53
This page was automatically generated by Maven