psa_key_policy_permits() function
Test whether a policy permits an algorithm. The caller must test usage flags separately.
Return value
PSA_SUCCESS When \p alg is a specific algorithm allowed by the \p policy. PSA_ERROR_INVALID_ARGUMENT When \p alg is not a specific algorithm PSA_ERROR_NOT_PERMITTED When \p alg is a specific algorithm, but the \p policy does not allow it.
Notes
This function requires providing the key type for which the policy is being validated, since some algorithm policy definitions (e.g. MAC) have different properties depending on what kind of cipher it is combined with.