diff options
Diffstat (limited to 'include/keymaster/authorization_set.h')
-rw-r--r-- | include/keymaster/authorization_set.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/keymaster/authorization_set.h b/include/keymaster/authorization_set.h index 5be5d83..ec68de0 100644 --- a/include/keymaster/authorization_set.h +++ b/include/keymaster/authorization_set.h @@ -231,6 +231,14 @@ class AuthorizationSet : public Serializable, public keymaster_key_param_set_t { } /** + * Returns true if the set contains the specified tag and value. + */ + template <keymaster_tag_t Tag> + bool Contains(TypedTag<KM_UINT, Tag> tag, uint32_t val) const { + return ContainsIntValue(tag, val); + } + + /** * If the specified integer-typed \p tag exists, places its value in \p val and returns true. * If \p tag is not present, leaves \p val unmodified and returns false. */ @@ -442,6 +450,7 @@ class AuthorizationSet : public Serializable, public keymaster_key_param_set_t { bool GetTagValueBool(keymaster_tag_t tag) const; bool ContainsEnumValue(keymaster_tag_t tag, uint32_t val) const; + bool ContainsIntValue(keymaster_tag_t tag, uint32_t val) const; // Define elems_ and elems_size_ as aliases to params and length, respectively. This is to // avoid using the variables without the trailing underscore in the implementation. |