2002/03/21 01:19:32
[org.ibex.core.git] / src / org / bouncycastle / asn1 / DERT61String.java
1 package org.bouncycastle.asn1;
2
3 import java.io.*;
4
5 /**
6  * DER T61String (also the teletex string)
7  */
8 public class DERT61String
9     extends DERObject
10     implements DERString
11 {
12     String  string;
13
14     /**
15      * basic constructor - with bytes.
16      */
17     public DERT61String(
18         byte[]   string)
19     {
20         this.string = new String(string);
21     }
22
23     /**
24      * basic constructor - with string.
25      */
26     public DERT61String(
27         String   string)
28     {
29         this.string = string;
30     }
31
32     public String getString()
33     {
34         return string;
35     }
36
37     void encode(
38         DEROutputStream  out)
39         throws IOException
40     {
41         out.writeEncoded(T61_STRING, string.getBytes());
42     }
43 }