Solaris Trusted Extensions Administrator's Procedures

ProcedureHow 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(1M) man page.

Before You Begin

You must be in the Security Administrator role in the global zone. For details, see How to Enter the Global Zone in Trusted Extensions.

  1. To obtain a 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 : NEED TO KNOW"
      0x0004-08-68
    • 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 default label_encodings file, the text equivalent of a clearance label does not include a colon (:).



Example 11–5 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.