psa_restrict_key_policy() function
Restrict a key policy based on a constraint.
Arguments
key_type
The key type for which to restrict the policy
policy
The policy to restrict.
constraint
The policy constraint to apply.
Return value
#PSA_SUCCESS \c *policy contains the intersection of the original value of \c *policy and \c *constraint. #PSA_ERROR_INVALID_ARGUMENT \c key_type, \c *policy and \c *constraint are incompatible. \c *policy is unchanged.
Notes
This function requires providing the key type for which the policy is being restricted, since some algorithm policy definitions (e.g. MAC) have different properties depending on what kind of cipher it is combined with.