ASN.1 Identifier Assignment

This section covers how the identifier for an ASN.1 NamedType is assigned when creating the components of an ASN.1 SEQUENCE or CHOICE.

First, we need to determine whether there is a CSN.1 name to use as our basis. When a CSN.1 string is mapped to a component, the mapping procedure will have already assigned a CSN.1 name, if there is one to be used as the basis. When a CSN.1 string is mapped to an ASN.1 type, we can attempt to locate a CSN.1 name as follows. Divide the string into a determinant and remainder part. If the remainder is labeled, use the label name as the CSN.1 name. Otherwise, if the string itself is labeled, use that name. If neither of those cases applies, then if the string is an exponential string (it has an exponent), the string is mapped to an ASN.1 SEQUENCE OF, and the base of the string has a labeled remainder part (if you split it into a determinant and remainder), then use that label name; in this case, the ASN.1 identifier will have a "-list" suffix, as noted below.

If we now have a CSN.1 name, we use the mapping of CSN.1 name to ASN.1 identifier to produce the ASN.1 identifier. If the previous step called for it, we append a "-list" suffix to the result. We now have our ASN.1 identifier. Otherwise, we assign an ASN.1 identifer directly. If the invoking procedure is creating a SEQUENCE, names are of the form "component-n". If the invoking procedure is creating a CHOICE, names are of the form "choice-n". In either case, n equals the number of components already added to the SEQUENCE or CHOICE, plus 1.

Note

The mapping procedures (this one included) do not ensure that type or component names are unique. If unique names are not produced so that the ASN.1 is in error, then the CSN.1 specification is considered to be in error as well, for the purposes of the mapping. To resolve this problem, the CSN.1 must be adjusted.