KickJava   Java API By Example, From Geeks To Geeks.

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


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

19 public class DERPrintableString extends DERObject {
20
21 /**
22  * Constructs DERPrintableString object with characters defined in the given
23  * String
24  * @param s0 content of DERPrintableString
25  * @exception SMIMEException thrown in super class constructor.
26  */

27   public DERPrintableString (String JavaDoc s0) throws SMIMEException
28   {
29     super(19);
30     byte[] temp = null;
31     try {
32       temp = s0.getBytes("ISO-8859-1");
33     }
34     catch(Exception JavaDoc e) {
35       throw SMIMEException.getInstance(this, e, "constructor" );
36     }
37     this.addContent(temp);
38   }
39
40 /**
41  * Constructs DERPrintableString object with characters defined in the given
42  * byte array
43  * @param b0 content of DERPrintableString
44  * @exception SMIMEException thrown in super class constructor.
45  */

46   public DERPrintableString (byte[] b0) throws SMIMEException
47   {
48     super(19);
49     this.addContent(b0);
50   }
51 }
52
53
54
55
Popular Tags