Slide 27 of 41
Notes:
The ASN.1 tag name-space is not a simple integer.
There are different “colours” of tag, called classes. The names broadly indicate their normal use, but such use (see the next slide) is largely a matter of “style”.
It would be perfectly possible to take a specification using only context specific tagging (numbers on their own in square brackets) and to replace all tags with APPLICATION class tags. The bits on the line would change (the “colour” gets encoded), but the specification would still be legal, and the encodings would be no more and no less verbose.
The only real rule in relation to classes is that that part of the tag name-space that is the UNIVERSAL class is reserved for allocation in the ASN.1 standard itself. It provides name-space for the allocation of a “default tag” to all the ASN.1 types and construction mechanisms.
So the encoding of an untagged INTEGER has a “T” part in the TLV that carries the default tag (of “colour” UNIVERSAL) for INTEGER.
The encoding of all untagged SEQUENCE types have a “T” part in the TLV that carries the default tag assigned to SEQUENCE.
Note that if there are several untagged SEQUENCE types specified in an application, they will all encode with the same tag, but that will be distinct from the tag encoded for any untagged INTEGER or BOOLEAN or NULL types (all of which have different default tags).