hexBinaryOneAndOnly Function Description
Description
This function takes in a bag of attributes of type hexBinary and returns a single value. It only works if the bag contains a single value. If the bag contains zero values or more than 1 value than the function will trigger an error yielding Indeterminate. Use this function when you need to compare an attribute to a single value. See example below.
hexBinaryOneAndOnly belongs to the ALFA function reference's
Bag functions category. It maps to the XACML function identifier
urn:oasis:names:tc:xacml:1.0:function:hexBinary-one-and-only, takes 1 argument and returns a value of type hexBinary.
| Property | Value |
|---|---|
| Category | Bag functions |
| # Arguments | 1 |
| Arguments |
|
| Return Value | hexBinary |
| Expressed As | pre-fix |
| Representation | ALFA short name |
| Allowed In Target | false |
| ALFA Shorthand | None |
| Commutative | false |
Example
/**
* Should anyone really use hexBinary in a policy? I doubt it but here's an example anyway.
*/
rule hexBinaryOneAndOnlyExample{
permit
condition hexBinaryOneAndOnly(hexValue)=="0CD7":hexBinary
}
In this example, access is permitted if the value of the hexBinary attribute is 0CD7. We highly recommend not using opaque datatypes in your policies.
See Also
Related Functions
Other functions in the Bag functions category: