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