BOOLEAN

The ASN.1 BOOLEAN type represents a truth value, indicating either TRUE or FALSE.

In Python, the generated BOOLEAN class wraps the native bool type, providing encoding, decoding, and constraint checks compliant with ASN.1 rules.

Example ASN.1 definition:

MyBoolean ::= BOOLEAN

which generates a Python class roughly equivalent to:

class MyBoolean(_Asn1BasicType[bool]):
    pass

Conceptual Representation

class _Asn1BasicType[bool]

Represents a Boolean ASN.1 type.

__init__(self, value: bool | None = None) None

Initializes the BOOLEAN instance with an optional initial value.

property value: bool

Gets or sets the Boolean value.

Setting the value accepts any Python object coercible to bool, e.g., 0, 1, True, False.