Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Primitive Types

The following primitive ASN.1 types are available as Python classes in the synta package. Each section below links to the detailed API reference.

Numeric types

ClassASN.1 typeTag
IntegerINTEGER0x02
BooleanBOOLEAN0x01
RealREAL0x09
NullNULL0x05

See Numeric Types for full API reference.

String types

ClassASN.1 typeTagCharacter set
Utf8StringUTF8String0x0cUnicode
PrintableStringPrintableString0x13Restricted ASCII
IA5StringIA5String0x16ASCII (0x00–0x7f)
NumericStringNumericString0x12Digits and space
TeletexStringTeletexString / T61String0x14Arbitrary bytes (Latin-1 decode)
VisibleStringVisibleString0x1aPrintable ASCII
GeneralStringGeneralString0x1bArbitrary bytes (Latin-1 decode)
UniversalStringUniversalString0x1cUCS-4 big-endian
BmpStringBMPString0x1eUCS-2 big-endian (BMP only)

See String Types for full API reference.

Time types

ClassASN.1 typeTag
UtcTimeUTCTime0x17
GeneralizedTimeGeneralizedTime0x18

See Time Types for full API reference.

Bit and octet strings

ClassASN.1 typeTag
OctetStringOCTET STRING0x04
BitStringBIT STRING0x03

See Bit and Octet Strings for full API reference.

Tagged and raw elements

ClassDescription
TaggedElementReturned by decode_any() for explicitly-tagged or application/private-tagged values.
RawElementReturned by decode_any() for unknown universal tags.

See Tagged and Raw Elements for full API reference.