Go to main content

Trusted Extensions Configuration and Administration

Exit Print View

Updated: March 2019
 
 

How to Obtain the Hexadecimal Equivalent for a Label

This procedure provides an internal hexadecimal representation of a label. This representation is safe for storing in a public directory. For more information, see the atohexlabel(8) man page.

  • To obtain the hexadecimal value for a label, do one of the following:
    • To obtain the hexadecimal value for a sensitivity label, pass the label to the command.
      # atohexlabel "CONFIDENTIAL : INTERNAL USE ONLY"
      0x0004-08-48

        The string is not case-sensitive, but whitespace must be exact. For example, the following quoted strings return a hexadecimal label:

      • "CONFIDENTIAL : INTERNAL USE ONLY"

      • "cnf : Internal"

      • "confidential : internal"

        The following quoted strings return a parsing error:

      • "confidential:internal"

      • "confidential: internal"

    • To obtain the hexadecimal value for a clearance, use the –c option.
      # atohexlabel -c "CONFIDENTIAL NEED TO KNOW"
      0x0004-08-68

      Note - Human readable sensitivity labels and clearance labels are formed according to rules in the label_encodings file. Each type of label uses rules from a separate section of this file. When a sensitivity label and a clearance label both express the same underlying level of sensitivity, the labels have identical hexadecimal forms. However, the labels can have different human readable forms. System interfaces that accept human readable labels as input expect one type of label. If the text strings for the label types differ, these text strings cannot be used interchangeably.

      In the label_encodings file, the text equivalent of a clearance label does not include a colon (:).


Example 11  Using the atohexlabel Command

When you pass a valid label in hexadecimal format, the command returns the argument.

# atohexlabel 0x0004-08-68
0x0004-08-68

When you pass an administrative label, the command returns the argument.

# atohexlabel admin_high
ADMIN_HIGH
atohexlabel admin_low
ADMIN_LOW

Troubleshooting

The error message atohexlabel parsing error found in <string> at position 0 indicates that the <string> argument that you passed to atohexlabel was not a valid label or clearance. Check your typing, and check that the label exists in your installed label_encodings file.