public class ASN1String extends java.lang.Object implements ASN1TaggedObject
The following types are supported.
PRINTABLE_STRINGT61STRINGIA5STRINGGRAPHIC_STRINGVISIBLE_STRINGGENERAL_STRINGBMP_STRINGUNIVERSAL_STRINGUTF8_STRINGOf these, only BMP_STRING and UTF_STRING allow the representation of Unicode (16-bit) characters. All others treat strings consisting of 8-bit characters only.
The default is IA5STRING.
The input may be any valid BER encoding of one of the above types. The output is always a DER encoding.
| Constructor and Description |
|---|
ASN1String(java.io.InputStream is) |
ASN1String(java.lang.String value)
Create a new
ASN1String with the given string value and the ASN1.IA5STRING type. |
ASN1String(java.lang.String value, int type)
Create a new
ASN1String with the given string value and the given type. |
| Modifier and Type | Method and Description |
|---|---|
ASN1Header |
getHeader() |
int |
getTag() |
java.lang.String |
getValue() |
void |
input(java.io.InputStream is)
Inputs this object from the specified input stream.
|
static java.lang.String |
inputValue(java.io.InputStream is) |
int |
length()
Length of this object's encoding.
|
void |
output(java.io.OutputStream os)
Outputs this object to the specified output stream.
|
static void |
outputValue(java.io.OutputStream os, java.lang.String value) |
static void |
outputValue(java.io.OutputStream os, java.lang.String value, int tag) |
static void |
outputValueWithTag(java.io.OutputStream os, java.lang.String value, int tag) |
java.lang.String |
toString() |
public ASN1String(java.lang.String value)
ASN1String with the given string value and the ASN1.IA5STRING type.
public ASN1String(java.lang.String value,
int type)
ASN1String with the given string value and the given type.
public ASN1String(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic ASN1Header getHeader()
getHeader in interface ASN1TaggedObjectpublic java.lang.String getValue()
public int getTag()
public java.lang.String toString()
toString in class java.lang.Object
public void input(java.io.InputStream is)
throws java.io.IOException
Streamableinput in interface Streamablejava.io.IOException
public static java.lang.String inputValue(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public void output(java.io.OutputStream os)
throws java.io.IOException
Streamableoutput in interface Streamablejava.io.IOExceptionpublic int length()
Streamablelength in interface Streamable
public static void outputValue(java.io.OutputStream os,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public static void outputValue(java.io.OutputStream os,
java.lang.String value,
int tag)
throws java.io.IOException
java.io.IOException
public static void outputValueWithTag(java.io.OutputStream os,
java.lang.String value,
int tag)
throws java.io.IOException
java.io.IOException