Skip to content

Support for writing IMPLICIT values #296

@ivan-tkatchev

Description

@ivan-tkatchev

It seems it's impossible to write an [APPLICATION 1] IMPLICIT INTEGER value due to this:

  File ".../python3.13/site-packages/asn1.py", line 243, in write
    self._emit_length(len(value))
                      ~~~^^^^^^^
TypeError: object of type 'int' has no len()

and this:

    def _encode_value(self, cls, nr, value):  # type: (int, int, any) -> bytes
        """Encode a value."""
        if cls != Classes.Universal:
            return value

How is this supposed to work? There is no documentation for IMPLICIT tagging. In fact, judging by the code it seems like only Universal class is supported for primitive types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions