TAGGED

pouzi priklad str. 54 vnorene CHOICE

Sometimes it is really very difficult to ensure that all the components of specified structure are distinct. Each simple type or structure construct could be mentioned only once in any specification. Of course, it is not enough for most of applications. That's why, ASN.1 offers a special syntax called tagging, which alows you to distict between two or more components of the same type by adding a unique number to it. This number appears between the reference name and type in square brackets:

The same tag may be reused as many times as needed until distinction criteria are broken.

While these tags form so called context specific class, standard built-in types form universal class. There are two more tag classes, but they are used only a few and should be avoided. Just for your info, application wide tag, which differs from tag by using keyword APPLICATION inside the square brackets was intended to be used in application wide range to be of a common utility.

The fourth class is called private use tags. Having a self explanatory name, it was used to define tags private to some organisation to produce an extensions to structures without affecting those made by others. The notation is simmilar to application wide tags, just the keyword is PRIVATE.

It is much more better to use ANY type in this case.

Very often a structure includes some other nested structures which have tagged references. Sometimes it is desirable that not only the outermost tags are represented in encoded information. This can be !!!zabezpecene!! by defining tags as explicit. There are four keywords for this purpose:

But in fact, explicitly defining explicit or implicit tags is rarely in use.