|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--iaik.asn1.ASN1Object
|
+--iaik.asn1.BOOLEAN
This class implements the native ASN.1 type "BOOLEAN".
BOOLEAN is a simple non-string ASN.1 type represented by the UNIVERSAL TAG number 1.
Possible values are TRUE and FALSE.
For supplying a Java boolean value when creating a new BOOLEAN object, an
application shall use the corresponding BOOLEAN(boolean value)
constructor, e.g:
boolean value = true; BOOLEAN asn1Boolean = new BOOLEAN(boolean_value);When calling the
getValue method for getting the inherent value
from an ASN.1 BOOLEAN instance, a Java object of type Boolean is returned:
Boolean boolValue = (Boolean)asn1Boolean.getValue(); boolean value = boolValue.booleanValue();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.
ASN1Object,
ASN| Fields inherited from class iaik.asn1.ASN1Object |
asnType,
encode_listener,
stream_mode |
| Constructor Summary | |
protected |
BOOLEAN()
Creates an empty object. |
|
BOOLEAN(boolean value)
Creates a new ASN.1 BOOLEAN object for the given Java boolean value. |
| Method Summary | |
protected void |
decode(int length,
java.io.InputStream is)
Decodes a BOOLEAN value from the given InputStream. |
protected void |
encode(java.io.OutputStream os)
DER encodes this BOOLEAN ASN1Object and writes the result to the given output stream. |
java.lang.Object |
getValue()
Returns the value of this BOOLEAN as a Java object of type Boolean. |
void |
setValue(java.lang.Object value)
Sets the value of this BOOLEAN. |
java.lang.String |
toString()
Returns a string that represents the contents of this BOOLEAN ASN.1 object. |
| 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 |
| Constructor Detail |
protected BOOLEAN()
public BOOLEAN(boolean value)
value - the boolean value this BOOLEAN object should represent| Method Detail |
public java.lang.Object getValue()
Boolean.public void setValue(java.lang.Object value)
Boolean.value - the Java Boolean value to be set for this BOOLEAN object
protected void encode(java.io.OutputStream os)
throws java.io.IOException
encode methods of the
DerCoder class for performing
the encoding, and the DerCoder internally will call this
encode method.os - the output stream to which to write the data
protected void decode(int length,
java.io.InputStream is)
throws java.io.IOException,
CodingException
length bytes to be read represent the value of an
ASN.1 object of type BOOLEAN.
This is a protected method and will not be used by
an application for decoding a DER encoded BOOLEAN. 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 BOOLEAN
object and internally calls this decode
method for actually reading the value.
length - the already decoded length, i.e. number of the bytes representing the
value of the BOOLEAN to be decoded; since a BOOLEAN value only will occupy
one byte, length has to be 1is - the input stream from which the DER encoded data is read inpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||