Skip to content

der: Encoding higher tag number #1381

Description

@xaqq

Hello,

I have an use case where I need to DER-encode ASN.1 message using greater than 30 for tag number.
I noticed in some comments that "This library deliberately does not support this: tag numbers greater than 30 are disallowed.".

I realize that TagNumber are an enumeration in this library, which makes arbitrarily high tag number problematic.
I am curious if you would consider lifting this limitation and willing to accept patches.

I can imagine 2 approaches:
+ Increase max tag number to 127, and support 2-bytes encoding of tags. Since 127 is still reasonable number it sounds like it would acceptable to have tag number up to TagNumber::N127.
+ Accept large number by using u64 or u128. This might be a too big impact the library API.

Thank you,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions