iaik.asn1
Class NULL
java.lang.Object
|
+--iaik.asn1.ASN1Object
|
+--iaik.asn1.NULL
- public class NULL
- extends ASN1Object
This class implements the native ASN.1 type "NULL".
NULL is a simple non-string ASN.1 type identified by the UNIVERSAL TAG number 5.
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 00
Consequently, 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.
- See Also:
ASN1Object,
ASN
|
Constructor Summary |
NULL()
Allocates a NULL object. |
|
Method Summary |
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. |
| Methods inherited from class iaik.asn1.ASN1Object |
addComponent,
addEncodeListener,
countComponents,
encodeObject,
getAsnType,
getComponentAt,
indefiniteLength,
isA,
isConstructed,
setIndefiniteLength,
setIndefiniteRecursive |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
NULL
public NULL()
- Allocates a NULL object.
getValue
public java.lang.Object getValue()
- Returns
null.
- Overrides:
- getValue in class ASN1Object
- Returns:
- the value of this NULL object which always is
null
setValue
public void setValue(java.lang.Object object)
- Does nothing. Only implements abstract method from ASN1Object.
- Overrides:
- setValue in class ASN1Object
- Parameters:
object - an Object which is used for nothing
encode
protected void encode(java.io.OutputStream os)
- DER encodes this NULL ASN1Object and writes the result to the given output stream.
Since a
NULL object does not have a value, this method actually
does nothing.
- Overrides:
- encode in class ASN1Object
- Parameters:
os - the output stream to which to write the data
decode
protected void decode(int length,
java.io.InputStream is)
- Decodes a NULL value from the given InputStream.
Since a
NULL object does not have a value, this method actually
does nothing.
- Overrides:
- decode in class ASN1Object
- Parameters:
length - the length of the ASN1Object which shall be decodedis - the input stream from which the der encoded data is read in
toString
public java.lang.String toString()
- Returns a string that represents the contents of this NULL ASN1Object.
- Overrides:
- toString in class ASN1Object
- Returns:
- the string representation
- See Also:
ASN1Object.toString()