Home
last modified time | relevance | path

Searched refs:key_metadata (Results 1 – 23 of 23) sorted by relevance

/system/security/keystore2/test_utils/
Dkey_generations.rs562 Ok(key_metadata) => { in generate_ec_p256_signing_key()
563 assert!(key_metadata.certificate.is_some()); in generate_ec_p256_signing_key()
565 assert!(key_metadata.certificateChain.is_some()); in generate_ec_p256_signing_key()
568 assert!(key_metadata.key.blob.is_some()); in generate_ec_p256_signing_key()
572 &key_metadata.authorizations, in generate_ec_p256_signing_key()
576 Ok(key_metadata) in generate_ec_p256_signing_key()
599 let key_metadata = sec_level.generateKey( in generate_ec_key() localVariable
608 assert!(key_metadata.certificate.is_some()); in generate_ec_key()
611 assert!(key_metadata.certificateChain.is_none()); in generate_ec_key()
614 assert!(key_metadata.key.blob.is_some()); in generate_ec_key()
[all …]
/system/security/keystore2/tests/
Dkeystore2_client_key_id_domain_tests.rs60 let key_metadata = key_generations::generate_ec_key( in keystore2_find_key_with_key_id_as_domain() localVariable
74 nspace: key_metadata.key.nspace, in keystore2_find_key_with_key_id_as_domain()
81 assert_eq!(key_metadata.key, key_entry_response.metadata.key); in keystore2_find_key_with_key_id_as_domain()
82 assert_eq!(key_metadata.certificate, key_entry_response.metadata.certificate); in keystore2_find_key_with_key_id_as_domain()
83 assert_eq!(key_metadata.certificateChain, key_entry_response.metadata.certificateChain); in keystore2_find_key_with_key_id_as_domain()
84 assert_eq!(key_metadata.key.nspace, key_entry_response.metadata.key.nspace); in keystore2_find_key_with_key_id_as_domain()
117 let key_metadata = key_generations::generate_ec_key( in keystore2_key_id_alias_rebind_verify_by_alias() localVariable
139 assert_ne!(key_metadata.key, new_key_metadata.key); in keystore2_key_id_alias_rebind_verify_by_alias()
140 assert_ne!(key_metadata.certificate, new_key_metadata.certificate); in keystore2_key_id_alias_rebind_verify_by_alias()
141 assert_ne!(key_metadata.key.nspace, new_key_metadata.key.nspace); in keystore2_key_id_alias_rebind_verify_by_alias()
[all …]
Dkeystore2_client_delete_key_tests.rs34 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_delete_key_success() localVariable
43 keystore2.deleteKey(&key_metadata.key).expect("Failed to delete a key."); in keystore2_delete_key_success()
46 let result = key_generations::map_ks_error(keystore2.getKeyEntry(&key_metadata.key)); in keystore2_delete_key_success()
77 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_delete_key_with_blob_domain_fail() localVariable
86 let result = key_generations::map_ks_error(keystore2.deleteKey(&key_metadata.key)); in keystore2_delete_key_with_blob_domain_fail()
99 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_delete_key_blob_success() localVariable
108 let result = sec_level.deleteKey(&key_metadata.key); in keystore2_delete_key_blob_success()
138 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_delete_key_blob_fail() localVariable
147 let result = key_generations::map_ks_error(sec_level.deleteKey(&key_metadata.key)); in keystore2_delete_key_blob_fail()
Dkeystore2_client_ec_key_tests.rs67 let key_metadata = in create_ec_key_and_operation() localVariable
71 &key_metadata.key, in create_ec_key_and_operation()
206 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_get_key_entry_blob_fail() localVariable
216 let result = key_generations::map_ks_error(keystore2.getKeyEntry(&key_metadata.key)); in keystore2_get_key_entry_blob_fail()
221 sec_level.deleteKey(&key_metadata.key).unwrap(); in keystore2_get_key_entry_blob_fail()
321 let key_metadata = key_generations::generate_ec_key( in keystore2_ec_25519_generate_key_success() localVariable
333 &key_metadata.key, in keystore2_ec_25519_generate_key_success()
367 let key_metadata = key_generations::generate_ec_key( in keystore2_ec_25519_generate_key_fail() localVariable
382 &key_metadata.key, in keystore2_ec_25519_generate_key_fail()
401 let key_metadata = key_generations::generate_ec_key( in keystore2_create_op_with_incompatible_key_digest() localVariable
[all …]
Dkeystore2_client_aes_key_tests.rs44 let key_metadata = key_generations::generate_sym_key( in create_aes_key_and_operation() localVariable
60 &key_metadata.key, in create_aes_key_and_operation()
72 &key_metadata.key, in create_aes_key_and_operation()
232 let key_metadata = sec_level in keystore2_aes_key_op_fails_multi_block_modes() localVariable
254 &key_metadata.key, in keystore2_aes_key_op_fails_multi_block_modes()
280 let key_metadata = sec_level in keystore2_aes_key_op_fails_multi_padding_modes() localVariable
302 &key_metadata.key, in keystore2_aes_key_op_fails_multi_padding_modes()
319 let key_metadata = key_generations::generate_sym_key( in keystore2_aes_key_op_fails_incompatible_padding() localVariable
336 &key_metadata.key, in keystore2_aes_key_op_fails_incompatible_padding()
351 let key_metadata = key_generations::generate_sym_key( in keystore2_aes_key_op_fails_incompatible_blockmode() localVariable
[all …]
Dkeystore2_client_3des_key_tests.rs41 let key_metadata = key_generations::generate_sym_key( in create_3des_key_and_operation() localVariable
58 &key_metadata.key, in create_3des_key_and_operation()
69 &key_metadata.key, in create_3des_key_and_operation()
137 let key_metadata = sec_level in keystore2_3des_key_fails_missing_padding() localVariable
157 &key_metadata.key, in keystore2_3des_key_fails_missing_padding()
173 let key_metadata = key_generations::generate_sym_key( in keystore2_3des_key_encrypt_fails_invalid_input_length() localVariable
190 .createOperation(&key_metadata.key, &op_params, false) in keystore2_3des_key_encrypt_fails_invalid_input_length()
Dkeystore2_client_import_keys_tests.rs52 let key_metadata = in import_rsa_sign_key_and_perform_sample_operation() localVariable
58 &key_metadata, in import_rsa_sign_key_and_perform_sample_operation()
66 key_metadata: &KeyMetadata, in perform_sym_key_encrypt_decrypt_op()
74 &key_metadata.key, in perform_sym_key_encrypt_decrypt_op()
87 &key_metadata.key, in perform_sym_key_encrypt_decrypt_op()
326 let key_metadata = key_generations::import_ec_p_256_key( in keystore2_import_ec_key_success() localVariable
335 perform_sample_asym_sign_verify_op(&sec_level, &key_metadata, None, Some(Digest::SHA_2_256)); in keystore2_import_ec_key_success()
376 let key_metadata = key_generations::import_aes_key(&sec_level, Domain::APP, -1, Some(alias)) in keystore2_import_aes_key_success() localVariable
379 perform_sym_key_encrypt_decrypt_op(&sec_level, &key_metadata); in keystore2_import_aes_key_success()
394 let key_metadata = key_generations::import_3des_key(&sec_level, Domain::APP, -1, Some(alias)) in keystore2_import_3des_key_success() localVariable
[all …]
Dkeystore2_client_authorizations_tests.rs68 let key_metadata = key_generations::generate_key(sec_level, &gen_params, alias).unwrap(); in gen_key_including_unique_id() localVariable
71 key_metadata.certificate.as_ref().unwrap(), in gen_key_including_unique_id()
73 key_metadata.keySecurityLevel, in gen_key_including_unique_id()
86 let key_metadata = key_generations::generate_key(sec_level, gen_params, alias)?; in generate_key_and_perform_sign_verify_op_max_times() localVariable
90 perform_sample_asym_sign_verify_op(sec_level, &key_metadata, None, Some(Digest::SHA_2_256)); in generate_key_and_perform_sign_verify_op_max_times()
93 Ok(key_metadata) in generate_key_and_perform_sign_verify_op_max_times()
108 let key_metadata = generate_key_and_perform_sign_verify_op_max_times( in generate_key_and_perform_op_with_max_usage_limit() localVariable
116 let auth = key_generations::get_key_auth(&key_metadata.authorizations, Tag::USAGE_COUNT_LIMIT) in generate_key_and_perform_op_with_max_usage_limit()
127 key_metadata.certificate.as_ref().unwrap(), in generate_key_and_perform_op_with_max_usage_limit()
146 &key_metadata.key, in generate_key_and_perform_op_with_max_usage_limit()
[all …]
Dkeystore2_client_update_subcomponent_tests.rs37 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_update_subcomponent_success() localVariable
50 .updateSubcomponent(&key_metadata.key, Some(&other_cert), Some(&other_cert_chain)) in keystore2_update_subcomponent_success()
53 let key_entry_response = keystore2.getKeyEntry(&key_metadata.key).unwrap(); in keystore2_update_subcomponent_success()
178 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_update_subcomponent_fails_permission_denied() localVariable
190 .grant(&key_metadata.key, GRANTEE_1_UID.try_into().unwrap(), access_vector) in keystore2_update_subcomponent_fails_permission_denied()
198 .grant(&key_metadata.key, GRANTEE_2_UID.try_into().unwrap(), access_vector) in keystore2_update_subcomponent_fails_permission_denied()
Dkeystore2_client_keystore_engine_tests.rs50 let key_metadata = sec_level in generate_rsa_key_and_grant_to_user() localVariable
65 assert!(key_metadata.certificate.is_some()); in generate_rsa_key_and_grant_to_user()
67 keystore2.grant(&key_metadata.key, grantee_uid, access_vector) in generate_rsa_key_and_grant_to_user()
85 let key_metadata = sec_level in generate_ec_key_and_grant_to_user() localVariable
100 assert!(key_metadata.certificate.is_some()); in generate_ec_key_and_grant_to_user()
102 keystore2.grant(&key_metadata.key, grantee_uid, access_vector) in generate_ec_key_and_grant_to_user()
Dkeystore2_client_device_unique_attestation_tests.rs142 Ok(key_metadata) => { in generate_device_unique_attested_key_with_device_attest_ids()
144 key_metadata.certificate.as_ref().unwrap(), in generate_device_unique_attested_key_with_device_attest_ids()
146 key_metadata.keySecurityLevel, in generate_device_unique_attested_key_with_device_attest_ids()
220 Ok(key_metadata) => { in keystore2_gen_ec_key_device_unique_attest_with_strongbox_sec_level_test_success()
223 &key_metadata, in keystore2_gen_ec_key_device_unique_attest_with_strongbox_sec_level_test_success()
267 Ok(key_metadata) => { in keystore2_gen_rsa_key_device_unique_attest_with_strongbox_sec_level_test_success()
270 &key_metadata, in keystore2_gen_rsa_key_device_unique_attest_with_strongbox_sec_level_test_success()
Dkeystore2_client_test_utils.rs150 let key_metadata = in generate_ec_key_and_grant_to_users() localVariable
156 let granted_key = keystore2.grant(&key_metadata.key, uid, access_vector)?; in generate_ec_key_and_grant_to_users()
177 let key_metadata = in create_signing_operation() localVariable
182 &key_metadata.key, in create_signing_operation()
264 key_metadata: &KeyMetadata, in perform_sample_asym_sign_verify_op()
276 let sign_op = sec_level.createOperation(&key_metadata.key, &authorizations, false).unwrap(); in perform_sample_asym_sign_verify_op()
285 let cert_bytes = key_metadata.certificate.as_ref().unwrap(); in perform_sample_asym_sign_verify_op()
Dkeystore2_client_grant_key_tests.rs44 let key_metadata = key_generations::generate_ec_p256_signing_key( in generate_ec_key_and_grant_to_user() localVariable
53 keystore2.grant(&key_metadata.key, grantee_uid, access_vector) in generate_ec_key_and_grant_to_user()
549 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_ungrant_fails_with_non_existing_key_expect_key_not_found_error() localVariable
560 .grant(&key_metadata.key, GRANTEE_UID.try_into().unwrap(), access_vector) in keystore2_ungrant_fails_with_non_existing_key_expect_key_not_found_error()
565 keystore2.deleteKey(&key_metadata.key).unwrap(); in keystore2_ungrant_fails_with_non_existing_key_expect_key_not_found_error()
569 keystore2.ungrant(&key_metadata.key, GRANTEE_UID.try_into().unwrap()), in keystore2_ungrant_fails_with_non_existing_key_expect_key_not_found_error()
Dkeystore2_client_operation_tests.rs318 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_ops_prune_test() localVariable
331 &key_metadata.key, in keystore2_ops_prune_test()
357 &key_metadata.key, in keystore2_ops_prune_test()
Dkeystore2_client_attest_key_tests.rs541 let key_metadata = in generate_attested_key_with_device_attest_ids() localVariable
553 assert!(key_metadata.certificate.is_some()); in generate_attested_key_with_device_attest_ids()
554 assert!(key_metadata.certificateChain.is_none()); in generate_attested_key_with_device_attest_ids()
557 cert_chain.extend(key_metadata.certificate.as_ref().unwrap()); in generate_attested_key_with_device_attest_ids()
563 key_metadata.certificate.as_ref().unwrap(), in generate_attested_key_with_device_attest_ids()
Dkeystore2_client_hmac_key_tests.rs38 let key_metadata = in create_hmac_key_and_operation() localVariable
42 &key_metadata.key, in create_hmac_key_and_operation()
Dkeystore2_client_list_entries_tests.rs90 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_list_entries_success() localVariable
111 .grant(&key_metadata.key, GRANTEE_UID.try_into().unwrap(), access_vector) in keystore2_list_entries_success()
129 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_list_entries_success() localVariable
148 keystore2.deleteKey(&key_metadata.key).unwrap(); in keystore2_list_entries_success()
Dkeystore2_client_rsa_key_tests.rs88 let key_metadata = in create_rsa_key_and_operation() localVariable
106 sec_level.createOperation(&key_metadata.key, &op_params, forced_op.0) in create_rsa_key_and_operation()
/system/security/keystore2/tests/legacy_blobs/
Dkeystore2_legacy_blob_tests.rs170 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_encrypted_characteristics() localVariable
200 &key_metadata.key.blob.unwrap(), in keystore2_encrypted_characteristics()
215 make_cert_blob_file(path_buf.as_path(), key_metadata.certificate.as_ref().unwrap()) in keystore2_encrypted_characteristics()
219 if let Some(chain) = key_metadata.certificateChain.as_ref() { in keystore2_encrypted_characteristics()
244 for param in key_metadata.authorizations { in keystore2_encrypted_characteristics()
250 cert: key_metadata.certificate.unwrap(), in keystore2_encrypted_characteristics()
251 cert_chain: key_metadata.certificateChain.unwrap_or_default(), in keystore2_encrypted_characteristics()
421 let key_metadata = key_generations::generate_ec_p256_signing_key( in keystore2_encrypted_certificates() localVariable
451 &key_metadata.key.blob.unwrap(), in keystore2_encrypted_certificates()
468 key_metadata.certificate.as_ref().unwrap(), in keystore2_encrypted_certificates()
[all …]
/system/security/keystore2/src/
Draw_device.rs122 let mut key_metadata = KeyMetaData::new(); in create_and_store_key() localVariable
123 key_metadata.add(KeyMetaEntry::CreationDate(creation_date)); in create_and_store_key()
133 &key_metadata, in create_and_store_key()
Dsecurity_level.rs185 let mut key_metadata = KeyMetaData::new(); in store_new_key() localVariable
186 key_metadata.add(KeyMetaEntry::CreationDate(creation_date)); in store_new_key()
196 &key_metadata, in store_new_key()
Dsuper_key.rs769 let mut key_metadata = KeyMetaData::new(); in create_super_key() localVariable
771 key_metadata.add(KeyMetaEntry::Sec1PublicKey(pk)); in create_super_key()
774 .store_super_key(user_id, key_type, &encrypted_super_key, &blob_metadata, &key_metadata) in create_super_key()
Ddatabase.rs1320 key_metadata: &KeyMetaData, in store_super_key()
1343 key_metadata.store_in_db(key_id, tx).context("KeyMetaData::store_in_db failed")?; in store_super_key()