Class Definitions

Python class definitions are generated for the following ASN.1 types:

The class definition for a composite type such as a SEQUENCE contains a constructor, encode/decode methods for different encoding rules, and other methods depending on selected compilation options. For example, if -print is specified, an __str__ method is generated to create a string representation of data in the class, and a print_value method is added to print the value to standard output.

In the other cases, the class contains only static methods that call the underlying primitive encode or decode function and then check the constraint values. For ENUMERATED, a dict is generated that associates identifier names with integer values. For a BIT STRING with named bits, a class is generated to enable bit manipulation by bit name.