Lines Matching refs:tag

186      * Returns the offset of the next entry that matches \p tag, starting from the element after \p
189 int find(keymaster_tag_t tag, int begin = -1) const;
218 * Returns true if the set contains at least one instance of \p tag
220 bool Contains(keymaster_tag_t tag) const {
221 return find(tag) != -1;
225 * Returns the number of \p tag entries.
227 size_t GetTagCount(keymaster_tag_t tag) const;
230 * Returns true if the set contains the specified tag and value.
233 bool Contains(TypedEnumTag<KM_ENUM_REP, Tag, T> tag, T val) const {
234 return ContainsEnumValue(tag, val);
238 * Returns true if the set contains the specified tag and value.
241 bool Contains(TypedEnumTag<KM_ENUM, Tag, T> tag, T val) const {
242 return ContainsEnumValue(tag, val);
246 * Returns true if the set contains the specified tag and value.
249 bool Contains(TypedTag<KM_UINT, Tag> tag, uint32_t val) const {
250 return ContainsIntValue(tag, val);
254 * If the specified integer-typed \p tag exists, places its value in \p val and returns true.
255 * If \p tag is not present, leaves \p val unmodified and returns false.
258 inline bool GetTagValue(TypedTag<KM_UINT, T> tag, uint32_t* val) const {
259 return GetTagValueInt(tag, val);
263 * If the specified instance of the specified integer-typed \p tag exists, places its value
264 * in \p val and returns true. If \p tag is not present, leaves \p val unmodified and returns
268 bool GetTagValue(TypedTag<KM_UINT_REP, Tag> tag, size_t instance, uint32_t* val) const {
269 return GetTagValueIntRep(tag, instance, val);
273 * If the specified long-typed \p tag exists, places its value in \p val and returns true.
274 * If \p tag is not present, leaves \p val unmodified and returns false.
277 inline bool GetTagValue(TypedTag<KM_ULONG, T> tag, uint64_t* val) const {
278 return GetTagValueLong(tag, val);
282 * If the specified instance of the specified integer-typed \p tag exists, places its value
283 * in \p val and returns true. If \p tag is not present, leaves \p val unmodified and returns
287 bool GetTagValue(TypedTag<KM_ULONG_REP, Tag> tag, size_t instance, uint64_t* val) const {
288 return GetTagValueLongRep(tag, instance, val);
292 * If the specified enumeration-typed \p tag exists, places its value in \p val and returns
293 * true. If \p tag is not present, leaves \p val unmodified and returns false.
296 bool GetTagValue(TypedEnumTag<KM_ENUM, Tag, T> tag, T* val) const {
297 return GetTagValueEnum(tag, reinterpret_cast<uint32_t*>(val));
301 * If the specified instance of the specified enumeration-typed \p tag exists, places its value
302 * in \p val and returns true. If \p tag is not present, leaves \p val unmodified and returns
306 bool GetTagValue(TypedEnumTag<KM_ENUM_REP, Tag, T> tag, size_t instance, T* val) const {
307 return GetTagValueEnumRep(tag, instance, reinterpret_cast<uint32_t*>(val));
311 * If exactly one instance of the specified enumeration-typed \p tag exists, places its value in
312 * \p val and returns true. If \p tag is not present or if multiple copies are present, leaves
316 bool GetTagValue(TypedEnumTag<KM_ENUM_REP, Tag, T> tag, T* val) const {
317 if (GetTagCount(tag) != 1)
319 return GetTagValueEnumRep(tag, 0, reinterpret_cast<uint32_t*>(val));
323 * If the specified date-typed \p tag exists, places its value in \p val and returns
324 * true. If \p tag is not present, leaves \p val unmodified and returns false.
327 bool GetTagValue(TypedTag<KM_UINT_REP, Tag> tag, size_t instance,
329 return GetTagValueIntRep(tag, instance, val);
333 * If the specified bytes-typed \p tag exists, places its value in \p val and returns
334 * true. If \p tag is not present, leaves \p val unmodified and returns false.
337 bool GetTagValue(TypedTag<KM_BYTES, Tag> tag, keymaster_blob_t* val) const {
338 return GetTagValueBlob(tag, val);
342 * If the specified bignum-typed \p tag exists, places its value in \p val and returns
343 * true. If \p tag is not present, leaves \p val unmodified and returns false.
346 bool GetTagValue(TypedTag<KM_BIGNUM, Tag> tag, keymaster_blob_t* val) const {
347 return GetTagValueBlob(tag, val);
351 * Returns true if the specified tag is present, and therefore has the value 'true'.
353 template <keymaster_tag_t Tag> bool GetTagValue(TypedTag<KM_BOOL, Tag> tag) const {
354 return GetTagValueBool(tag);
358 * If the specified \p tag exists, places its value in \p val and returns true. If \p tag is
362 bool GetTagValue(TypedTag<Type, Tag> tag, typename TagValueType<Type>::value_type* val) const {
363 return GetTagValueLong(tag, val);
383 * Append the tag and enumerated value to the set.
386 bool push_back(TypedEnumTag<Type, Tag, KeymasterEnum> tag, KeymasterEnum val) {
387 return push_back(Authorization(tag, val));
391 * Append the boolean tag (value "true") to the set.
393 template <keymaster_tag_t Tag> bool push_back(TypedTag<KM_BOOL, Tag> tag) {
394 return push_back(Authorization(tag));
398 * Append the tag and byte array to the set. Copies the array into internal storage; does not
402 bool push_back(TypedTag<KM_BYTES, Tag> tag, const void* bytes, size_t bytes_len) {
403 return push_back(keymaster_param_blob(tag, static_cast<const uint8_t*>(bytes), bytes_len));
407 * Append the tag and blob to the set. Copies the blob contents into internal storage; does not
411 bool push_back(TypedTag<KM_BYTES, Tag> tag, const keymaster_blob_t& blob) {
412 return push_back(tag, blob.data, blob.data_length);
416 * Append the tag and bignum array to the set. Copies the array into internal storage; does not
420 bool push_back(TypedTag<KM_BIGNUM, Tag> tag, const void* bytes, size_t bytes_len) {
421 return push_back(keymaster_param_blob(tag, static_cast<const uint8_t*>(bytes), bytes_len));
425 bool push_back(TypedTag<Type, Tag> tag, typename TypedTag<Type, Tag>::value_type val) {
426 return push_back(Authorization(tag, val));
430 bool push_back(TypedTag<Type, Tag> tag, const void* bytes, size_t bytes_len) {
431 return push_back(Authorization(tag, bytes, bytes_len));
454 bool GetTagValueEnum(keymaster_tag_t tag, uint32_t* val) const;
455 bool GetTagValueEnumRep(keymaster_tag_t tag, size_t instance, uint32_t* val) const;
456 bool GetTagValueInt(keymaster_tag_t tag, uint32_t* val) const;
457 bool GetTagValueIntRep(keymaster_tag_t tag, size_t instance, uint32_t* val) const;
458 bool GetTagValueLong(keymaster_tag_t tag, uint64_t* val) const;
459 bool GetTagValueLongRep(keymaster_tag_t tag, size_t instance, uint64_t* val) const;
460 bool GetTagValueDate(keymaster_tag_t tag, uint64_t* val) const;
461 bool GetTagValueBlob(keymaster_tag_t tag, keymaster_blob_t* val) const;
462 bool GetTagValueBool(keymaster_tag_t tag) const;
464 bool ContainsEnumValue(keymaster_tag_t tag, uint32_t val) const;
465 bool ContainsIntValue(keymaster_tag_t tag, uint32_t val) const;
482 AuthorizationSetBuilder& Authorization(TagType tag, ValueType value) {
483 set.push_back(tag, value);
488 AuthorizationSetBuilder& Authorization(TypedTag<KM_BOOL, Tag> tag) {
489 set.push_back(tag);
494 AuthorizationSetBuilder& Authorization(TypedTag<KM_INVALID, Tag> tag) {
496 param.tag = tag;
502 AuthorizationSetBuilder& Authorization(TypedTag<KM_BYTES, Tag> tag, const uint8_t* data,
504 set.push_back(tag, data, data_length);
509 AuthorizationSetBuilder& Authorization(TypedTag<KM_BYTES, Tag> tag, const char* data,
511 return Authorization(tag, reinterpret_cast<const uint8_t*>(data), data_length);