Lines Matching refs:attributes
144 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
153 mbedtls_set_key_owner_id(&attributes, owner_id);
158 psa_set_key_usage_flags(&attributes, usage_flags);
159 psa_set_key_algorithm(&attributes, alg);
160 psa_set_key_type(&attributes, type);
161 PSA_ASSERT(psa_import_key(&attributes, key_data->x, key_data->len,
164 PSA_ASSERT(psa_get_key_attributes(key, &attributes));
165 TEST_EQUAL(psa_get_key_type(&attributes), type);
166 psa_reset_key_attributes(&attributes);
177 TEST_EQUAL(psa_get_key_attributes(key_with_invalid_owner, &attributes),
187 PSA_ASSERT(psa_get_key_attributes(key, &attributes));
188 TEST_EQUAL(psa_get_key_type(&attributes), type);
189 psa_reset_key_attributes(&attributes);
201 TEST_EQUAL(psa_get_key_attributes(key, &attributes),
207 * Key attributes may have been returned by psa_get_key_attributes()
210 psa_reset_key_attributes(&attributes);
231 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
247 psa_set_key_id(&attributes, id);
248 psa_set_key_lifetime(&attributes, lifetime);
249 psa_set_key_type(&attributes, type);
250 psa_set_key_usage_flags(&attributes, usage_flags);
251 psa_set_key_algorithm(&attributes, alg);
252 psa_set_key_enrollment_algorithm(&attributes, alg2);
253 PSA_ASSERT(psa_import_key(&attributes, key_data->x, key_data->len,
262 PSA_ASSERT(psa_get_key_attributes(id, &attributes));
263 TEST_EQUAL(psa_get_key_lifetime(&attributes), lifetime);
265 psa_get_key_id(&attributes), id));
266 TEST_EQUAL(psa_get_key_usage_flags(&attributes),
268 TEST_EQUAL(psa_get_key_algorithm(&attributes), alg);
269 TEST_EQUAL(psa_get_key_enrollment_algorithm(&attributes), alg2);
270 TEST_EQUAL(psa_get_key_type(&attributes), type);
282 PSA_ASSERT(psa_get_key_attributes(handle, &attributes));
283 TEST_EQUAL(psa_get_key_lifetime(&attributes), lifetime);
285 psa_get_key_id(&attributes), id));
286 TEST_EQUAL(psa_get_key_usage_flags(&attributes),
288 TEST_EQUAL(psa_get_key_algorithm(&attributes), alg);
289 TEST_EQUAL(psa_get_key_enrollment_algorithm(&attributes), alg2);
290 TEST_EQUAL(psa_get_key_type(&attributes), type);
315 TEST_EQUAL(psa_get_key_lifetime(&attributes),
318 psa_get_key_id(&attributes),
320 TEST_EQUAL(psa_get_key_usage_flags(&attributes),
322 TEST_EQUAL(psa_get_key_algorithm(&attributes),
324 TEST_EQUAL(psa_get_key_enrollment_algorithm(&attributes),
326 TEST_EQUAL(psa_get_key_type(&attributes),
328 TEST_EQUAL(psa_get_key_bits(&attributes),
360 * Key attributes may have been returned by psa_get_key_attributes()
363 psa_reset_key_attributes(&attributes);
378 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
392 psa_set_key_id(&attributes, id);
393 psa_set_key_lifetime(&attributes, lifetime);
394 psa_set_key_type(&attributes, type1);
395 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_EXPORT);
396 psa_set_key_algorithm(&attributes, 0);
397 PSA_ASSERT(psa_import_key(&attributes, material1, sizeof(material1),
406 TEST_EQUAL(psa_import_key(&attributes, material2, sizeof(material2),
416 psa_reset_key_attributes(&attributes);
417 PSA_ASSERT(psa_get_key_attributes(id, &attributes));
419 psa_get_key_id(&attributes), id));
420 TEST_EQUAL(psa_get_key_lifetime(&attributes), lifetime);
421 TEST_EQUAL(psa_get_key_type(&attributes), type1);
422 TEST_EQUAL(psa_get_key_bits(&attributes), bits1);
423 TEST_EQUAL(psa_get_key_usage_flags(&attributes), PSA_KEY_USAGE_EXPORT);
424 TEST_EQUAL(psa_get_key_algorithm(&attributes), 0);
436 * Key attributes may have been returned by psa_get_key_attributes()
439 psa_reset_key_attributes(&attributes);
469 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
479 psa_set_key_lifetime(&attributes, lifetime);
483 * PSA key attributes APIs thus accessing to the attributes
486 attributes.id = id;
488 psa_set_key_id(&attributes, id);
491 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
492 TEST_EQUAL(psa_import_key(&attributes, material, sizeof(material),
550 /* Update the attributes with the bit size. */
619 * Source and target key attributes may have been returned by
654 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
665 psa_set_key_id(&attributes, source_id);
666 psa_set_key_lifetime(&attributes, source_lifetime);
668 psa_set_key_type(&attributes, source_type);
669 psa_set_key_usage_flags(&attributes, source_usage);
670 psa_set_key_algorithm(&attributes, source_alg);
671 PSA_ASSERT(psa_import_key(&attributes,
692 psa_set_key_id(&attributes, target_id);
693 psa_set_key_lifetime(&attributes, target_lifetime);
695 &attributes, &new_key),
730 * Key attributes may have been returned by psa_get_key_attributes()
749 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
755 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
756 psa_set_key_usage_flags(&attributes, 0);
757 psa_set_key_algorithm(&attributes, 0);
758 PSA_ASSERT(psa_import_key(&attributes,
785 PSA_ASSERT(psa_import_key(&attributes,
799 TEST_EQUAL(psa_get_key_attributes(invalid_handle, &attributes),
805 PSA_ASSERT(psa_get_key_attributes(valid_handle, &attributes));
806 TEST_EQUAL(psa_get_key_type(&attributes), PSA_KEY_TYPE_RAW_DATA);
807 TEST_EQUAL(psa_get_key_bits(&attributes),
813 * Key attributes may have been returned by psa_get_key_attributes()
816 psa_reset_key_attributes(&attributes);
829 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
836 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_EXPORT);
837 psa_set_key_algorithm(&attributes, 0);
838 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
842 status = psa_import_key(&attributes,
886 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
902 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_EXPORT);
903 psa_set_key_algorithm(&attributes, 0);
904 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
909 status = psa_import_key(&attributes,
921 status = psa_import_key(&attributes,
945 status = psa_import_key(&attributes,
987 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
994 psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_EXPORT);
995 psa_set_key_algorithm(&attributes, 0);
996 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
1003 psa_set_key_id(&attributes, key);
1004 PSA_ASSERT(psa_import_key(&attributes,
1018 psa_set_key_id(&attributes, key);
1019 psa_set_key_lifetime(&attributes, lifetime);
1021 PSA_ASSERT(psa_import_key(&attributes,
1063 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
1081 psa_set_key_usage_flags(&attributes,
1083 psa_set_key_algorithm(&attributes, 0);
1084 psa_set_key_type(&attributes, PSA_KEY_TYPE_RAW_DATA);
1090 psa_set_key_id(&attributes, persistent_key);
1091 PSA_ASSERT(psa_import_key(&attributes,
1107 psa_set_key_lifetime(&attributes, PSA_KEY_LIFETIME_VOLATILE);
1109 PSA_ASSERT(psa_import_key(&attributes,
1113 psa_reset_key_attributes(&attributes);
1120 status = psa_get_key_attributes(persistent_key, &attributes);
1137 PSA_ASSERT(psa_get_key_attributes(persistent_key, &attributes));
1138 TEST_ASSERT(mbedtls_svc_key_id_equal(attributes.id,
1147 psa_set_key_id(&attributes, persistent_key2);
1148 status = psa_copy_key(persistent_key, &attributes, &returned_key_id);
1175 * Key attributes may have been returned by psa_get_key_attributes()
1178 psa_reset_key_attributes(&attributes);