When do tags have to be distinct?
Only to avoid ambiguous encodings
Outermost tag should distinguish between types
Three cases where distinct tags are needed to avoid ambiguous encodings
EXAM 2! Try to spot all three cases before going on.
Notes:
The ASN.1 specification requires that the user of the notation changes tags if necessary so that an doubt about the type that is being encoded in a particular TLV is completely determined by the outermost “T”.
Put another way, the outermost tags of the tag-lists of types appearing in certain places are often required to be distinct.
What are those places? There are actually three cases where use of types that had the same outermost tags could lead to ambiguity. Can you find all three cases?
HINT: Remember that the only difference between a SET and a SEQUENCE is that BER says that it is a sender’s option which order to encode the elements of a SET. The elements of a SEQUENCE are encoded in the order they are written.