public class ASN1Boolean extends ASN1Primitive
Use following to place a new instance of ASN.1 Boolean in your dataset:
ASN1Boolean.getInstance(boolean)
ASN1Boolean.getInstance(int)
Modifier and Type | Field and Description |
---|---|
static ASN1Boolean |
FALSE |
private static byte[] |
FALSE_VALUE |
static ASN1Boolean |
TRUE |
private static byte[] |
TRUE_VALUE |
private byte[] |
value |
Constructor and Description |
---|
ASN1Boolean(boolean value)
Deprecated.
use getInstance(boolean) method.
|
ASN1Boolean(byte[] value) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
asn1Equals(ASN1Primitive o) |
(package private) void |
encode(ASN1OutputStream out) |
(package private) int |
encodedLength() |
(package private) static ASN1Boolean |
fromOctetString(byte[] value) |
static ASN1Boolean |
getInstance(ASN1TaggedObject obj,
boolean explicit)
return a Boolean from a tagged object.
|
static ASN1Boolean |
getInstance(boolean value)
return an ASN1Boolean from the passed in boolean.
|
static ASN1Boolean |
getInstance(int value)
return an ASN1Boolean from the passed in value.
|
static ASN1Boolean |
getInstance(Object obj)
return a boolean from the passed in object.
|
int |
hashCode() |
(package private) boolean |
isConstructed() |
boolean |
isTrue() |
String |
toString() |
equals, fromByteArray, toASN1Primitive, toDERObject, toDLObject
getEncoded, getEncoded, hasEncodedTagValue, toASN1Object
private static final byte[] TRUE_VALUE
private static final byte[] FALSE_VALUE
private byte[] value
public static final ASN1Boolean FALSE
public static final ASN1Boolean TRUE
ASN1Boolean(byte[] value)
public ASN1Boolean(boolean value)
value
- true or false.public static ASN1Boolean getInstance(Object obj)
obj
- an ASN1Boolean or an object that can be converted into one.IllegalArgumentException
- if the object cannot be converted.public static ASN1Boolean getInstance(boolean value)
public static ASN1Boolean getInstance(int value)
public static ASN1Boolean getInstance(ASN1TaggedObject obj, boolean explicit)
obj
- the tagged object holding the object we wantexplicit
- true if the object is meant to be explicitly
tagged false otherwise.IllegalArgumentException
- if the tagged object cannot
be converted.public boolean isTrue()
boolean isConstructed()
isConstructed
in class ASN1Primitive
int encodedLength()
encodedLength
in class ASN1Primitive
void encode(ASN1OutputStream out) throws IOException
encode
in class ASN1Primitive
IOException
protected boolean asn1Equals(ASN1Primitive o)
asn1Equals
in class ASN1Primitive
public int hashCode()
hashCode
in class ASN1Primitive
static ASN1Boolean fromOctetString(byte[] value)