65.9K
CodeProject is changing. Read more.
Home

Complete (so far) Enumeration of ASN.1 TAGs

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Jul 9, 2021

CPOL
viewsIcon

33429

I found even the official documented lists of ASN.1 TAGs incomplete. So after scrounging around I was able to piece together a complete list (so far).

ASN.1, an old standard and though prevalent, does not seem to be any longer changing.

public enum TAG : byte
{
    BOOLEAN = 0x01,
    INTEGER = 0x02,
    BIT_STRING = 0x03,
    OCTET_STRING = 0x04,
    NULL_TAG = 0x05,
    OBJECT_IDENTIFIER = 0x06,  //a.k.a. OID
    OBJECT_DESCRIPTOR = 0x07,  //a.k.a. OID Descriptor
    EXTERNAL = 0x08,
    REAL = 0x09,
    ENUMERATED = 0x0a,
    EMBEDDED_PDV = 0x0b,
	UTF8_STRING = 0x0c,
    RELATIVE_OID = 0x0d,
    TIME = 0x0e,
    // Reserved 0x0f,
    SEQUENCE = 0x10,
    SET = 0x11,
    NUMERIC_STRING = 0x12,
    PRINTABLE_STRING = 0x13,
    T61_STRING = 0x14,
    VIDEOTEXT_STRING = 0x15,
    IA5_STRING = 0x16,
    UTC_TIME = 0x17,
    GENERALIZED_TIME = 0x18,
    GRAPHIC_STRING = 0x19,
    VISIBLE_STRING = 0x1a,
    GENERAL_STRING = 0x1b,
    UNIVERSAL_STRING = 0x1c,
    CHARACTER_STRING = 0x1d,
    BMP_STRING = 0x1e,
    DATE = 0x1f,
    TIME_OF_DAY = 0x20,
    DATE_TIME = 0x21,
    DURATION = 0x22,
    I18_OID = 0x23,  // Internationalized OID
    REL_I18_OID = 0x24  // Internationalized Relative OID
    // Reserved 0x25 and above
};