KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > oyster > der > DERIA5String


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.der;
10
11 import java.io.UnsupportedEncodingException JavaDoc;
12 import org.enhydra.oyster.exception.SMIMEException;
13 import org.enhydra.oyster.exception.ErrorStorage;
14
15
16 /**
17  * DERIA5String is primitive type of DER encoded object for one of
18  * different forms for representing character string type in ASN.1 notation.
19  */

20 public class DERIA5String extends DERObject {
21
22 /**
23  * Constructs DERIA5String object with characters defined in the given
24  * String
25  * @param s0 content of DERIA5String
26  * @exception SMIMEException thrown in super class constructor. Also, it can be
27  * caused by non SMIMEException which is: UnsupportedEncodingException.
28  */

29   public DERIA5String (String JavaDoc s0) throws SMIMEException
30   {
31     super(22);
32     byte[] temp = null;
33     try {
34       temp = s0.getBytes("ISO-8859-1");
35     }
36     catch(Exception JavaDoc 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   {
50     super(22);
51     this.addContent(b0);
52   }
53 }
54
55
56
57
Popular Tags