The ASN.1 IA5tring data type is encoded into a TLV triplet that begins with a Tag byte of 0x16. The following example, adapted from the CMC Encoded ASN.1 topic, shows how the OSVersion attribute is encoded as an IA5tring type. The version number can be specified by using the IX509AttributeOSVersion interface. The object identifier for the attribute is

06 0a                                   ; OBJECT_ID (a Bytes)
|  2b 06 01 04 01 82 37 0d  02 03       ; 
31 0c                                   ; SET (c Bytes)
   16 0a                                ; IA5_STRING (a Bytes)
      36 2e 30 2e 35 33 36 31  2e 32    ;   6.0.5361.2

If the string contains fewer than 128 bytes, the Length field of the TLV triplet requires only one byte to specify the content length. If the string is more than 127 bytes, bit 7 of the Length field is set to 1 and bits 6 through 0 specify the number of additional bytes used to identify the content length. For more information, see Encoded Length and Value Bytes.

Related topics

ASN.1 Type System
DER Encoding of ASN.1 Types



Community Additions