Mapping CSN.1 name to ASN.1 identifier

A CSN.1 name is mapped to an ASN.1 identifier as follows:

  1. Apply the name character conversion procedure (see below) to the name.

  2. If the name begins with an uppercase character, correct this as follows.

    1. Locate the end of the first word within the name. For this purpose, a word does not include a numeric digit or a hyphen.

    2. If the entire name has no lowercase letters, lowercase the entire name.

    3. Otherwise, if the first word has some lowercase letters, lowercase the first character of the name.

    4. Otherwise, if the name does not begin with a lowercase letter (it begins with a hyphen or digit) prepend the character 'a' to the result.

  3. This completes the procedure. The name is a valid ASN.1 identifier.

The name character conversion procedure ensures the name consists of characters that are valid for an ASN.1 identifier or typereference. The procedure is as follows.

  1. Convert any character that is not legal in an ASN.1 identifier into a hyphen.

  2. Replace any sequence of hyphen characters with a single hyhpen.

  3. If the name ends with a hyphen, remove it. (It cannot end with multiple hyphens due to the previous step.)