Lines Matching refs:attributes
50 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
52 psa_set_key_lifetime( &attributes, key_lifetime );
53 psa_set_key_type( &attributes, key_type );
54 psa_set_key_bits( &attributes, key_bits );
55 psa_set_key_usage_flags( &attributes, key_usage );
56 psa_set_key_algorithm( &attributes, key_alg );
57 psa_set_key_enrollment_algorithm( &attributes, key_alg2 );
61 &attributes.core,
85 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
90 &attributes.core );
96 TEST_EQUAL( psa_get_key_lifetime( &attributes ),
98 TEST_EQUAL( psa_get_key_type( &attributes ),
100 TEST_EQUAL( psa_get_key_bits( &attributes ),
102 TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
104 TEST_EQUAL( psa_get_key_algorithm( &attributes ),
106 TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ),
122 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
128 psa_set_key_id( &attributes, key_id );
129 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
131 TEST_EQUAL( psa_import_key( &attributes, data, data_length, &key_id ),
154 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
158 psa_set_key_id( &attributes, key_id );
159 psa_set_key_type( &attributes, first_type );
161 PSA_ASSERT( psa_import_key( &attributes, first_data->x, first_data->len,
183 psa_set_key_id( &attributes, key_id );
184 psa_set_key_type( &attributes, second_type );
185 PSA_ASSERT( psa_import_key( &attributes, second_data->x, second_data->len,
204 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
208 psa_set_key_id( &attributes, key_id );
209 psa_set_key_type( &attributes, type );
210 TEST_EQUAL( psa_import_key( &attributes, data->x, data->len, &returned_key_id ),
229 psa_reset_key_attributes( &attributes );
230 PSA_ASSERT( psa_get_key_attributes( key_id, &attributes ) );
231 TEST_ASSERT( mbedtls_svc_key_id_equal( psa_get_key_id( &attributes ),
233 TEST_EQUAL( psa_get_key_lifetime( &attributes ),
235 TEST_EQUAL( psa_get_key_type( &attributes ), type );
236 TEST_EQUAL( psa_get_key_usage_flags( &attributes ), 0 );
237 TEST_EQUAL( psa_get_key_algorithm( &attributes ), 0 );
243 * Key attributes may have been returned by psa_get_key_attributes()
246 psa_reset_key_attributes( &attributes );
264 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
270 psa_set_key_id( &attributes, key_id );
271 psa_set_key_type( &attributes, type );
272 psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_EXPORT );
275 PSA_ASSERT( psa_import_key( &attributes, data->x, data->len,
287 psa_reset_key_attributes( &attributes );
288 PSA_ASSERT( psa_get_key_attributes( key_id, &attributes ) );
290 psa_get_key_id( &attributes ), key_id ) );
291 TEST_EQUAL( psa_get_key_lifetime( &attributes ),
293 TEST_EQUAL( psa_get_key_type( &attributes ), type );
294 TEST_EQUAL( psa_get_key_bits( &attributes ), (size_t) expected_bits );
295 TEST_EQUAL( psa_get_key_usage_flags( &attributes ), PSA_KEY_USAGE_EXPORT );
296 TEST_EQUAL( psa_get_key_algorithm( &attributes ), 0 );
316 * Key attributes may have been returned by psa_get_key_attributes()
319 psa_reset_key_attributes( &attributes );