public class NULL extends ASN1Object
An ASN.1 NULL object can represent only one value, null. It may be used
in situations where only the presence of a type is important, but no concrete value.
The DER encoding of the NULL type is primitive and only consists of
identifier (05) and length octets (00); no content octets are necessary:
id length 05 00Consequently, no value can be specified when creating a new
NULL
object; and when asking for a value by means of the getValue()
method, null is returned.ASN1Object,
ASNasnType, constructed, encode_listener, indefinite_length, isStringType, stream_mode| Constructor and Description |
|---|
NULL()
Allocates a NULL object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(int length,
java.io.InputStream is)
Decodes a NULL value from the given InputStream.
|
protected void |
encode(java.io.OutputStream os)
DER encodes this NULL ASN1Object and writes the result to the given output stream.
|
java.lang.Object |
getValue()
Returns
null. |
void |
setValue(java.lang.Object object)
Does nothing.
|
java.lang.String |
toString()
Returns a string that represents the contents of this NULL ASN1Object.
|
addComponent, addEncodeListener, clone, countComponents, encodeObject, getAsnType, getComponentAt, indefiniteLength, isA, isConstructed, isStringType, setIndefiniteLengthpublic java.lang.Object getValue()
null.getValue in class ASN1Objectnullpublic void setValue(java.lang.Object object)
setValue in class ASN1Objectobject - an Object which is used for nothingprotected void encode(java.io.OutputStream os)
NULL object does not have a value, this method actually
does nothing.encode in class ASN1Objectos - the output stream to which to write the dataprotected void decode(int length,
java.io.InputStream is)
NULL object does not have a value, this method actually
does nothing.decode in class ASN1Objectlength - the length of the ASN1Object which shall be decodedis - the input stream from which the der encoded data is read inpublic java.lang.String toString()
toString in class ASN1ObjectASN1Object.toString()