01: /*
02: * Title: Oyster Project
03: * Description: S/MIME email sending capabilities
04: * @Author Vladimir Radisic
05: * @Version 2.1.6
06: */
07:
08: package org.enhydra.oyster.der;
09:
10: import org.enhydra.oyster.exception.SMIMEException;
11: import org.enhydra.oyster.exception.ErrorStorage;
12:
13: /**
14: * DERPrintableString is primitive type of DER encoded object for one of
15: * different forms for representing character string type in ASN.1 notation.
16: */
17: public class DERPrintableString extends DERObject {
18:
19: /**
20: * Constructs DERPrintableString object with characters defined in the given
21: * String
22: * @param s0 content of DERPrintableString
23: * @exception SMIMEException thrown in super class constructor.
24: */
25: public DERPrintableString(String s0) throws SMIMEException {
26: super (19);
27: byte[] temp = null;
28: try {
29: temp = s0.getBytes("ISO-8859-1");
30: } catch (Exception e) {
31: throw new SMIMEException(e);
32: }
33: this .addContent(temp);
34: }
35:
36: /**
37: * Constructs DERPrintableString object with characters defined in the given
38: * byte array
39: * @param b0 content of DERPrintableString
40: * @exception SMIMEException thrown in super class constructor.
41: */
42: public DERPrintableString(byte[] b0) throws SMIMEException {
43: super (19);
44: this.addContent(b0);
45: }
46: }
|