Lines Matching refs:attributes

124     psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
133 mbedtls_set_key_owner_id( &attributes, owner_id );
138 psa_set_key_usage_flags( &attributes, usage_flags );
139 psa_set_key_algorithm( &attributes, alg );
140 psa_set_key_type( &attributes, type );
141 PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
144 PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
145 TEST_EQUAL( psa_get_key_type( &attributes ), type );
146 psa_reset_key_attributes( &attributes );
168 PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
169 TEST_EQUAL( psa_get_key_type( &attributes ), type );
170 psa_reset_key_attributes( &attributes );
180 TEST_EQUAL( psa_get_key_attributes( key, &attributes ),
186 * Key attributes may have been returned by psa_get_key_attributes()
189 psa_reset_key_attributes( &attributes );
210 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
226 psa_set_key_id( &attributes, id );
227 psa_set_key_lifetime( &attributes, lifetime );
228 psa_set_key_type( &attributes, type );
229 psa_set_key_usage_flags( &attributes, usage_flags );
230 psa_set_key_algorithm( &attributes, alg );
231 psa_set_key_enrollment_algorithm( &attributes, alg2 );
232 PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
241 PSA_ASSERT( psa_get_key_attributes( id, &attributes ) );
242 TEST_EQUAL( psa_get_key_lifetime( &attributes ), lifetime );
244 psa_get_key_id( &attributes ), id ) );
245 TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
247 TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
248 TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ), alg2 );
249 TEST_EQUAL( psa_get_key_type( &attributes ), type );
261 PSA_ASSERT( psa_get_key_attributes( handle, &attributes ) );
262 TEST_EQUAL( psa_get_key_lifetime( &attributes ), lifetime );
264 psa_get_key_id( &attributes ), id ) );
265 TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
267 TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
268 TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ), alg2 );
269 TEST_EQUAL( psa_get_key_type( &attributes ), type );
293 TEST_EQUAL( psa_get_key_lifetime( &attributes ),
296 psa_get_key_id( &attributes ),
298 TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
300 TEST_EQUAL( psa_get_key_algorithm( &attributes ),
302 TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ),
304 TEST_EQUAL( psa_get_key_type( &attributes ),
306 TEST_EQUAL( psa_get_key_bits( &attributes ),
341 * Key attributes may have been returned by psa_get_key_attributes()
344 psa_reset_key_attributes( &attributes );
359 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
373 psa_set_key_id( &attributes, id );
374 psa_set_key_lifetime( &attributes, lifetime );
375 psa_set_key_type( &attributes, type1 );
376 psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_EXPORT );
377 psa_set_key_algorithm( &attributes, 0 );
378 PSA_ASSERT( psa_import_key( &attributes, material1, sizeof( material1 ),
386 TEST_EQUAL( psa_import_key( &attributes, material2, sizeof( material2 ),
395 psa_reset_key_attributes( &attributes );
396 PSA_ASSERT( psa_get_key_attributes( id, &attributes ) );
398 psa_get_key_id( &attributes ), id ) );
399 TEST_EQUAL( psa_get_key_lifetime( &attributes ), lifetime );
400 TEST_EQUAL( psa_get_key_type( &attributes ), type1 );
401 TEST_EQUAL( psa_get_key_bits( &attributes ), bits1 );
402 TEST_EQUAL( psa_get_key_usage_flags( &attributes ), PSA_KEY_USAGE_EXPORT );
403 TEST_EQUAL( psa_get_key_algorithm( &attributes ), 0 );
415 * Key attributes may have been returned by psa_get_key_attributes()
418 psa_reset_key_attributes( &attributes );
448 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
458 psa_set_key_lifetime( &attributes, lifetime );
463 * PSA key attributes APIs thus accessing to the attributes
466 attributes.core.id = id;
469 psa_set_key_id( &attributes, id );
471 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
472 TEST_EQUAL( psa_import_key( &attributes, material, sizeof( material ),
530 /* Update the attributes with the bit size. */
606 * Source and target key attributes may have been returned by
641 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
653 psa_set_key_id( &attributes, source_id );
654 psa_set_key_lifetime( &attributes, source_lifetime );
656 psa_set_key_type( &attributes, source_type );
657 psa_set_key_usage_flags( &attributes, source_usage );
658 psa_set_key_algorithm( &attributes, source_alg );
659 PSA_ASSERT( psa_import_key( &attributes,
683 psa_set_key_id( &attributes, target_id );
684 psa_set_key_lifetime( &attributes, target_lifetime );
686 &attributes, &new_key ),
721 * Key attributes may have been returned by psa_get_key_attributes()
740 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
746 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
747 psa_set_key_usage_flags( &attributes, 0 );
748 psa_set_key_algorithm( &attributes, 0 );
749 PSA_ASSERT( psa_import_key( &attributes,
783 PSA_ASSERT( psa_import_key( &attributes,
797 TEST_EQUAL( psa_get_key_attributes( invalid_handle, &attributes ),
803 PSA_ASSERT( psa_get_key_attributes( valid_handle, &attributes ) );
804 TEST_EQUAL( psa_get_key_type( &attributes ), PSA_KEY_TYPE_RAW_DATA );
805 TEST_EQUAL( psa_get_key_bits( &attributes ),
811 * Key attributes may have been returned by psa_get_key_attributes()
814 psa_reset_key_attributes( &attributes );
827 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
834 psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_EXPORT );
835 psa_set_key_algorithm( &attributes, 0 );
836 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
840 status = psa_import_key( &attributes,
874 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
881 psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_EXPORT );
882 psa_set_key_algorithm( &attributes, 0 );
883 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
891 psa_set_key_id( &attributes, key );
892 PSA_ASSERT( psa_import_key( &attributes,
906 psa_set_key_id( &attributes, key );
907 psa_set_key_lifetime( &attributes, lifetime );
909 PSA_ASSERT( psa_import_key( &attributes,
950 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
963 psa_set_key_usage_flags( &attributes,
965 psa_set_key_algorithm( &attributes, 0 );
966 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
972 psa_set_key_id( &attributes, persistent_key );
973 PSA_ASSERT( psa_import_key( &attributes,
982 psa_set_key_lifetime( &attributes, PSA_KEY_LIFETIME_VOLATILE );
985 PSA_ASSERT( psa_import_key( &attributes,
989 psa_reset_key_attributes( &attributes );
996 status = psa_get_key_attributes( persistent_key, &attributes );
1013 PSA_ASSERT( psa_get_key_attributes( persistent_key, &attributes ) );
1014 TEST_ASSERT( mbedtls_svc_key_id_equal( attributes.core.id,
1023 psa_set_key_id( &attributes, persistent_key2 );
1024 status = psa_copy_key( persistent_key, &attributes, &returned_key_id );
1052 * Key attributes may have been returned by psa_get_key_attributes()
1055 psa_reset_key_attributes( &attributes );