public class UNIString extends ASN1String
UniversalString is defined in ASN.1:1993.
When creating a new UNIString
object the value to be represented
has to be supplied as Java String
type:
String s = ...; UNIString uniString = new UNIString(s);Attention: When supplying the string value to be represented, no check is performed if it actually is composed only of characters belonging to UniversalString character set! An application itself has to take care for supplying a proper UniversalString value.
When calling the getValue
method for getting the inherent string
value from an ASN.1 UNIString instance, a Java object of type String
is returned:
String s = (String)uniString.getValue();DER en/decoding generally is done by means of the several methods of the
DerCoder
class; decoding alternatively may be performed by
using the DerInputStream
utility.
Attention! Since Java characters are UNICODE (16 bit), but UNIVERSAL STRING uses 32 bit, wrong (de)coding results may occur when characters occupy more than 16 bits!
ASN1Object
,
ASN
value
asnType, constructed, encode_listener, indefinite_length, isStringType, stream_mode
Modifier | Constructor and Description |
---|---|
protected |
UNIString()
Creates an empty UNIString.
|
|
UNIString(java.lang.String value)
Creates a new ASN.1 UNIString object for the given String value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue()
Returns the value of this UNIString as a String object.
|
void |
setValue(java.lang.Object object)
Sets the value of this UNIString.
|
clone, decode, encode, equals, getByteValue, hashCode, setIgnoreConstructedEncodingForSimpleTypes, setIndefiniteLength, toString
addComponent, addEncodeListener, countComponents, encodeObject, getAsnType, getComponentAt, indefiniteLength, isA, isConstructed, isStringType
protected UNIString()
public UNIString(java.lang.String value)
Attention: No check is performed if the supplied String value actually is composed only of characters belonging to the UniversalString character set! An application itself has to take care for supplying a proper UniversalString value.
value
- the String value this UNIString object should be initialized withpublic java.lang.Object getValue()
getValue
in class ASN1Object
public void setValue(java.lang.Object object)
The supplied value has to be a Java object of type String
.
Attention: No check is performed if the supplied String value
actually is composed only of characters belonging to UniversalString character
set! An application itself has to take care for supplying a proper UniversalString
value.
setValue
in class ASN1Object
object
- the Java String value to be set for this UNIString