public abstract class ASN1String extends ASN1Object
This class extends ASN1Object for
grouping all ASN.1 String type implementing classes.
BMPString,
GeneralString,
IA5String,
NumericString,
PrintableString,
T61String,
UNIString,
UTF8String,
VisibleString| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
value
The value as byte material representing the String value encoding.
|
asnType, constructed, encode_listener, indefinite_length, isStringType, stream_mode| Modifier | Constructor and Description |
|---|---|
protected |
ASN1String()
Creates an empty ASN1String.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(int length,
java.io.InputStream is)
Decodes a ASN1String value from the given InputStream.
|
protected void |
encode(java.io.OutputStream os)
DER encodes this ASN1String and writes the result to the
given output stream.
|
boolean |
equals(java.lang.Object obj)
Compares two ASN.1 Strings.
|
int |
hashCode()
Returns a hash code for this object.
|
java.lang.String |
toString()
Returns a string that represents the contents of this ASN1String.
|
addComponent, addEncodeListener, countComponents, encodeObject, getAsnType, getComponentAt, getValue, indefiniteLength, isA, isConstructed, isStringType, setAutomaticRepair, setAutomaticRepairRecursive, setIndefiniteLength, setIndefiniteRecursive, setValueprotected byte[] value
protected void encode(java.io.OutputStream os)
throws java.io.IOException
This is a protected method and will not be used by an application for
DER encoding a ASN1String object. An application will call one of the
encode methods of the DerCoder
class for performing the encoding, and the DerCoder internally will call
this encode method.
encode in class ASN1Objectos - the output stream to which to write the datajava.io.IOException - if an I/O error occurs while writing to the streamprotected void decode(int length,
java.io.InputStream is)
throws java.io.IOException
length bytes to be read represent the value of an
ASN.1 object of type ASN1String.
This is a protected method and will not be used by
an application for decoding a DER encoded ASN1String. An
application will call one of the decode methods of
the DerCoder class for performing
the decoding. The DerCoder then determines the number of bytes
(length) occupied by the value of this ASN1String
object and internally calls this decode method for
actually reading the value. No check is performed if the received
value actually is composed only of characters belonging to the
ASN1String typical character set!
decode in class ASN1Objectlength - the already decoded length, i.e. number of the bytes
representing the value of the ASN1String to be decodedis - the input stream from which the DER encoded data is read injava.io.IOException - if there is a problem with the InputStreampublic java.lang.String toString()
toString in class ASN1ObjectASN1Object.toString()public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the other ASN.1 Stringtrue, if the two ASN1Strings are equal,
false otherwisepublic int hashCode()
hashCode in class java.lang.Object