Encoded Tag Bytes

The Tag field in a TLV triplet identifies the type of the data structure being sent between computers. For example, the tag for an integer is 0x02, and the tag for an object identifier is 0x06. Although multiple bytes are permitted, none of the data types used by the Certificate Enrollment API require more than one. The following illustration shows the breakdown of a Tag value. Bits 7 and 6 identify the ASN.1 tagging class. There are four available classes, but the Certificate Enrollment API uses data types that belong only to the UNIVERSAL class. Bit 5 identifies whether the encoding form is primitive or constructed. Basic and string types are encoded by using primitive forms, constructed types by using a constructed form. For more information, see ASN.1 Type System. Bits 4 through 0 contain the tag number.

der tlv tag byte

The following table lists the data types supported by the Certificate Enrollment API, the encoding form used, and the tag value.

Type ASN.1 class Encoding form Tag value
BIT STRING UNIVERSAL Primitive 00000011
(0x03)
BOOLEAN UNIVERSAL Primitive 00000001
(0x01)
INTEGER UNIVERSAL Primitive 00000010
(0x02)
NULL UNIVERSAL Primitive 00000101
(0x05)
OBJECT IDENTIFIER UNIVERSAL Primitive 00000110
(0x06)
OCTET STRING UNIVERSAL Primitive 00000100
(0x04)
BMPString UNIVERSAL Primitive 00011110
(0x1E)
IA5String UNIVERSAL Primitive 00010110
(0x16)
PrintableString UNIVERSAL Primitive 00010011
(0x13)
TeletexString UNIVERSAL Primitive 00010100
(0x14)
UTF8String UNIVERSAL Primitive 00001100
(0x0C)
SEQUENCE UNIVERSAL Constructed 00110000
(0x30)
SEQUENCE OF UNIVERSAL Constructed 00110000
(0x30)
SET UNIVERSAL Constructed 00110001
(0x31)
SET OF UNIVERSAL Constructed 00110001
(0x31)

DER Transfer Syntax

Encoded Length and Value Bytes