Package org.bouncycastle.asn1
Class ASN1Boolean
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.ASN1Primitive
org.bouncycastle.asn1.ASN1Boolean
- All Implemented Interfaces:
ASN1Encodable
,Encodable
Public facade of ASN.1 Boolean data.
Use following to place a new instance of ASN.1 Boolean in your data:
- ASN1Boolean.TRUE literal
- ASN1Boolean.FALSE literal
-
ASN1Boolean.getInstance(boolean)
-
ASN1Boolean.getInstance(int)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static ASN1Boolean
getInstance
(ASN1TaggedObject obj, boolean explicit) Return a Boolean from a tagged object.int
hashCode()
boolean
isTrue()
toString()
Methods inherited from class org.bouncycastle.asn1.ASN1Primitive
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive
Methods inherited from class org.bouncycastle.asn1.ASN1Object
getEncoded, getEncoded, hasEncodedTagValue
-
Field Details
-
FALSE
-
TRUE
-
-
Method Details
-
getInstance
Return a boolean from the passed in object.- Parameters:
obj
- an ASN1Boolean or an object that can be converted into one.- Returns:
- an ASN1Boolean instance.
- Throws:
IllegalArgumentException
- if the object cannot be converted.
-
getInstance
Return an ASN1Boolean from the passed in boolean.- Parameters:
value
- true or false depending on the ASN1Boolean wanted.- Returns:
- an ASN1Boolean instance.
-
getInstance
Return an ASN1Boolean from the passed in value.- Parameters:
value
- non-zero (true) or zero (false) depending on the ASN1Boolean wanted.- Returns:
- an ASN1Boolean instance.
-
getInstance
Return a Boolean from a tagged object.- Parameters:
obj
- the tagged object holding the object we wantexplicit
- true if the object is meant to be explicitly tagged false otherwise.- Returns:
- an ASN1Boolean instance.
- Throws:
IllegalArgumentException
- if the tagged object cannot be converted.
-
isTrue
public boolean isTrue() -
hashCode
public int hashCode()- Specified by:
hashCode
in classASN1Primitive
-
toString
-