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.
# 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"
# atohexlabel -c "CONFIDENTIAL NEED TO KNOW" 0x0004-08-68
In the label_encodings file, the text equivalent of a clearance label does not include a colon (:).
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.