Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class ASN1Boolean

extends ASN1Primitive
Class Inheritance
Imports
java.io.IOException

Public facade of ASN.1 Boolean data.

Use following to place a new instance of ASN.1 Boolean in your data:

Field Summary

Modifier and TypeField and Description
public static final ASN1Boolean
private static final byte
public static final ASN1Boolean
private static final byte
pack-priv static final ASN1UniversalType
private final byte

Constructor Summary

AccessConstructor and Description
private
ASN1Boolean(byte value)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
asn1Equals(ASN1Primitive other)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

pack-priv static ASN1Boolean
createPrimitive(byte[] contents)

pack-priv void
encode(ASN1OutputStream out, boolean withTag)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

pack-priv boolean
encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

pack-priv int
public static ASN1Boolean

Returns:

an ASN1Boolean instance.
getInstance
(Object
an ASN1Boolean or an object that can be converted into one.
obj
)

Return a boolean from the passed in object.

public static ASN1Boolean

Returns:

an ASN1Boolean instance.
getInstance
(boolean
true or false depending on the ASN1Boolean wanted.
value
)

Return an ASN1Boolean from the passed in boolean.

public static ASN1Boolean

Returns:

an ASN1Boolean instance.
getInstance
(int
non-zero (true) or zero (false) depending on the ASN1Boolean wanted.
value
)

Return an ASN1Boolean from the passed in value.

public static ASN1Boolean

Returns:

an ASN1Boolean instance.
getInstance
(ASN1TaggedObject
the tagged object holding the object we want
taggedObject
,
boolean
true if the object is meant to be explicitly tagged false otherwise.
explicit
)

Return a Boolean from a tagged object.

public int
hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Returns a hash code value for this object.

public boolean
pack-priv ASN1Primitive
toDERObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Return the current object as one which encodes using Distinguished Encoding Rules.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.bouncycastle.asn1.ASN1Primitive:
encodeToencodeToequalsequalsequalsfromByteArraytoASN1PrimitivetoDLObject

Field Detail

FALSEback to summary
public static final ASN1Boolean FALSE
FALSE_VALUEback to summary
private static final byte FALSE_VALUE
TRUEback to summary
public static final ASN1Boolean TRUE
TRUE_VALUEback to summary
private static final byte TRUE_VALUE
TYPEback to summary
pack-priv static final ASN1UniversalType TYPE
valueback to summary
private final byte value

Constructor Detail

ASN1Booleanback to summary
private ASN1Boolean(byte value)

Method Detail

asn1Equalsback to summary
pack-priv boolean asn1Equals(ASN1Primitive other)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Doc from org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

createPrimitiveback to summary
pack-priv static ASN1Boolean createPrimitive(byte[] contents)
encodeback to summary
pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

encodeConstructedback to summary
pack-priv boolean encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

Returns:boolean

true if CONSTRUCTED bit set on object's tag, false otherwise.

encodedLengthback to summary
pack-priv int encodedLength(boolean withTag)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

getInstanceback to summary
public static ASN1Boolean getInstance(Object obj)

Return a boolean from the passed in object.

Parameters
obj:Object

an ASN1Boolean or an object that can be converted into one.

Returns:ASN1Boolean

an ASN1Boolean instance.

Exceptions
IllegalArgumentException:
if the object cannot be converted.
getInstanceback to summary
public static ASN1Boolean getInstance(boolean value)

Return an ASN1Boolean from the passed in boolean.

Parameters
value:boolean

true or false depending on the ASN1Boolean wanted.

Returns:ASN1Boolean

an ASN1Boolean instance.

getInstanceback to summary
public static ASN1Boolean getInstance(int value)

Return an ASN1Boolean from the passed in value.

Parameters
value:int

non-zero (true) or zero (false) depending on the ASN1Boolean wanted.

Returns:ASN1Boolean

an ASN1Boolean instance.

getInstanceback to summary
public static ASN1Boolean getInstance(ASN1TaggedObject taggedObject, boolean explicit)

Return a Boolean from a tagged object.

Parameters
taggedObject:ASN1TaggedObject

the tagged object holding the object we want

explicit:boolean

true if the object is meant to be explicitly tagged false otherwise.

Returns:ASN1Boolean

an ASN1Boolean instance.

Exceptions
IllegalArgumentException:
if the tagged object cannot be converted.
hashCodeback to summary
public int hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isTrueback to summary
public boolean isTrue()
toDERObjectback to summary
pack-priv ASN1Primitive toDERObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Doc from org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Return the current object as one which encodes using Distinguished Encoding Rules.

Returns:ASN1Primitive

a DER version of this.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object