Home
last modified time | relevance | path

Searched refs:KeyParameterValue (Results 1 – 25 of 27) sorted by relevance

12

/system/keymaster/ng/
DKeyMintUtils.cpp31 return KeyParameter{Tag::PURPOSE, KeyParameterValue::make<KeyParameterValue::keyPurpose>( in kmEnumParam2Aidl()
34 return KeyParameter{Tag::ALGORITHM, KeyParameterValue::make<KeyParameterValue::algorithm>( in kmEnumParam2Aidl()
37 return KeyParameter{Tag::BLOCK_MODE, KeyParameterValue::make<KeyParameterValue::blockMode>( in kmEnumParam2Aidl()
40 return KeyParameter{Tag::DIGEST, KeyParameterValue::make<KeyParameterValue::digest>( in kmEnumParam2Aidl()
45 KeyParameterValue::make<KeyParameterValue::digest>( in kmEnumParam2Aidl()
49 return KeyParameter{Tag::PADDING, KeyParameterValue::make<KeyParameterValue::paddingMode>( in kmEnumParam2Aidl()
52 return KeyParameter{Tag::EC_CURVE, KeyParameterValue::make<KeyParameterValue::ecCurve>( in kmEnumParam2Aidl()
56 KeyParameterValue::make<KeyParameterValue::hardwareAuthenticatorType>( in kmEnumParam2Aidl()
59 return KeyParameter{Tag::ORIGIN, KeyParameterValue::make<KeyParameterValue::origin>( in kmEnumParam2Aidl()
71 KeyParameterValue::make<KeyParameterValue::integer>(param.enumerated)}; in kmEnumParam2Aidl()
[all …]
/system/security/keystore2/src/legacy_blob/test_utils/
Dlegacy_blob_test_vectors.rs15 use crate::key_parameter::{KeyParameter, KeyParameterValue};
38 KeyParameter::new(KeyParameterValue::KeyPurpose(KeyPurpose::SIGN), SecurityLevel::KEYSTORE), in structured_test_params()
40 KeyParameterValue::KeyPurpose(KeyPurpose::VERIFY), in structured_test_params()
43 KeyParameter::new(KeyParameterValue::Digest(Digest::SHA_2_256), SecurityLevel::KEYSTORE), in structured_test_params()
45 KeyParameterValue::UserSecureID(2100322049669824240), in structured_test_params()
48 KeyParameter::new(KeyParameterValue::Algorithm(Algorithm::EC), SecurityLevel::KEYSTORE), in structured_test_params()
49 KeyParameter::new(KeyParameterValue::KeySize(256), SecurityLevel::KEYSTORE), in structured_test_params()
50 KeyParameter::new(KeyParameterValue::EcCurve(EcCurve::P_256), SecurityLevel::KEYSTORE), in structured_test_params()
52 KeyParameterValue::HardwareAuthenticatorType(HardwareAuthenticatorType::FINGERPRINT), in structured_test_params()
56 KeyParameterValue::KeyOrigin(KeyOrigin::GENERATED), in structured_test_params()
[all …]
/system/security/keystore2/test_utils/
Dauthorizations.rs21 KeyParameter::KeyParameter, KeyParameterValue::KeyParameterValue, KeyPurpose::KeyPurpose,
43 self.0.push(KeyParameter { tag: Tag::PURPOSE, value: KeyParameterValue::KeyPurpose(p) }); in purpose()
49 self.0.push(KeyParameter { tag: Tag::DIGEST, value: KeyParameterValue::Digest(d) }); in digest()
55 self.0.push(KeyParameter { tag: Tag::ALGORITHM, value: KeyParameterValue::Algorithm(a) }); in algorithm()
61 self.0.push(KeyParameter { tag: Tag::EC_CURVE, value: KeyParameterValue::EcCurve(e) }); in ec_curve()
69 value: KeyParameterValue::Blob(b), in attestation_challenge()
78 value: KeyParameterValue::BoolValue(true), in no_auth_required()
87 value: KeyParameterValue::LongInteger(e), in rsa_public_exponent()
94 self.0.push(KeyParameter { tag: Tag::KEY_SIZE, value: KeyParameterValue::Integer(s) }); in key_size()
100 self.0.push(KeyParameter { tag: Tag::BLOCK_MODE, value: KeyParameterValue::BlockMode(b) }); in block_mode()
[all …]
Dkey_generations.rs28 KeyOrigin::KeyOrigin, KeyParameter::KeyParameter, KeyParameterValue::KeyParameterValue,
444 && key_param.value == KeyParameterValue::KeyPurpose(KeyPurpose::ATTEST_KEY) in check_key_authorizations()
469 value: KeyParameterValue::Integer(get_os_version().try_into().unwrap()) in check_common_auths()
476 value: KeyParameterValue::Integer(get_os_patchlevel().try_into().unwrap()) in check_common_auths()
488 value: KeyParameterValue::Integer(get_vendor_patchlevel().try_into().unwrap()) in check_common_auths()
494 &KeyParameter { tag: Tag::ORIGIN, value: KeyParameterValue::Origin(expected_key_origin) } in check_common_auths()
500 value: KeyParameterValue::Integer( in check_common_auths()
689 value: KeyParameterValue::Digest(Digest::SHA1) in generate_rsa_key()
931 &KeyParameter { tag: Tag::ALGORITHM, value: KeyParameterValue::Algorithm(Algorithm::RSA) } in import_rsa_2048_key()
936 &KeyParameter { tag: Tag::KEY_SIZE, value: KeyParameterValue::Integer(2048) } in import_rsa_2048_key()
[all …]
Dffi_test_utils.cpp674 param.value.get<aidl::android::hardware::security::keymint::KeyParameterValue::blob>(); in getValueFromAttestRecord()
724 .get<aidl::android::hardware::security::keymint::KeyParameterValue::integer>()); in getValueFromAttestRecord()
737 param.value.get<aidl::android::hardware::security::keymint::KeyParameterValue::blob>(); in getValueFromAttestRecord()
/system/security/ondevice-signing/
DKeystoreHmacKey.cpp37 using android::hardware::security::keymint::KeyParameterValue;
70 algo.value = KeyParameterValue::make<KeyParameterValue::algorithm>(Algorithm::HMAC); in createKey()
75 key_size.value = KeyParameterValue::make<KeyParameterValue::integer>(kHmacKeySize); in createKey()
80 min_mac_length.value = KeyParameterValue::make<KeyParameterValue::integer>(256); in createKey()
85 digest.value = KeyParameterValue::make<KeyParameterValue::digest>(Digest::SHA_2_256); in createKey()
90 purposeSign.value = KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::SIGN); in createKey()
96 KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::VERIFY); in createKey()
101 auth.value = KeyParameterValue::make<KeyParameterValue::boolValue>(true); in createKey()
106 boot_level.value = KeyParameterValue::make<KeyParameterValue::integer>(mKeyBootLevel); in createKey()
133 if (auth.keyParameter.value.get<KeyParameterValue::integer>() == mKeyBootLevel) { in initialize()
[all …]
DKeystoreKey.cpp39 using android::hardware::security::keymint::KeyParameterValue;
77 algo.value = KeyParameterValue::make<KeyParameterValue::algorithm>(Algorithm::RSA); in createKey()
82 key_size.value = KeyParameterValue::make<KeyParameterValue::integer>(kRsaKeySize); in createKey()
87 digest.value = KeyParameterValue::make<KeyParameterValue::digest>(Digest::SHA_2_256); in createKey()
93 KeyParameterValue::make<KeyParameterValue::paddingMode>(PaddingMode::RSA_PKCS1_1_5_SIGN); in createKey()
98 exponent.value = KeyParameterValue::make<KeyParameterValue::longInteger>(kRsaKeyExponent); in createKey()
103 purpose.value = KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::SIGN); in createKey()
108 auth.value = KeyParameterValue::make<KeyParameterValue::boolValue>(true); in createKey()
113 boot_level.value = KeyParameterValue::make<KeyParameterValue::integer>(mKeyBootLevel); in createKey()
206 if (auth.keyParameter.value.get<KeyParameterValue::integer>() == mKeyBootLevel) { in verifyExistingKey()
[all …]
/system/security/keystore2/src/km_compat/
Dlib.rs36 KeyParameterValue::KeyParameterValue, KeyPurpose::KeyPurpose, PaddingMode::PaddingMode,
90 value: KeyParameterValue::Algorithm(Algorithm::RSA), in generate_rsa_key()
92 KeyParameter { tag: Tag::KEY_SIZE, value: KeyParameterValue::Integer(2048) }, in generate_rsa_key()
95 value: KeyParameterValue::LongInteger(65537), in generate_rsa_key()
97 KeyParameter { tag: Tag::DIGEST, value: KeyParameterValue::Digest(Digest::SHA_2_256) }, in generate_rsa_key()
100 value: KeyParameterValue::PaddingMode(PaddingMode::RSA_PSS), in generate_rsa_key()
102 KeyParameter { tag: Tag::NO_AUTH_REQUIRED, value: KeyParameterValue::BoolValue(true) }, in generate_rsa_key()
105 value: KeyParameterValue::KeyPurpose(KeyPurpose::SIGN), in generate_rsa_key()
109 value: KeyParameterValue::DateTime(0), in generate_rsa_key()
113 value: KeyParameterValue::DateTime(UNDEFINED_NOT_AFTER), in generate_rsa_key()
[all …]
/system/keymint/hal/src/
Dhal.rs38 use keymint::{KeyParameterValue::KeyParameterValue, Tag::Tag, TagType::TagType};
254 KeyParam::Purpose(v) => (Tag::PURPOSE, KeyParameterValue::KeyPurpose(v.innto())), in fromm()
255 KeyParam::Algorithm(v) => (Tag::ALGORITHM, KeyParameterValue::Algorithm(v.innto())), in fromm()
256 KeyParam::BlockMode(v) => (Tag::BLOCK_MODE, KeyParameterValue::BlockMode(v.innto())), in fromm()
257 KeyParam::Digest(v) => (Tag::DIGEST, KeyParameterValue::Digest(v.innto())), in fromm()
258 KeyParam::Padding(v) => (Tag::PADDING, KeyParameterValue::PaddingMode(v.innto())), in fromm()
259 KeyParam::EcCurve(v) => (Tag::EC_CURVE, KeyParameterValue::EcCurve(v.innto())), in fromm()
261 (Tag::RSA_OAEP_MGF_DIGEST, KeyParameterValue::Digest(v.innto())) in fromm()
263 KeyParam::Origin(v) => (Tag::ORIGIN, KeyParameterValue::Origin(v.innto())), in fromm()
266 KeyParam::KeySize(v) => (Tag::KEY_SIZE, KeyParameterValue::Integer(v.0 as i32)), in fromm()
[all …]
/system/security/keystore2/src/
Dsw_keyblob.rs24 KeyParameterValue::KeyParameterValue, KeyPurpose::KeyPurpose, PaddingMode::PaddingMode,
42 fn get_tag_value(params: &[KeyParameter], tag: Tag) -> Option<&KeyParameterValue> { in get_tag_value() argument
67 KeyParameterValue::Algorithm(Algorithm::AES) in export_key()
68 | KeyParameterValue::Algorithm(Algorithm::TRIPLE_DES) in export_key()
69 | KeyParameterValue::Algorithm(Algorithm::HMAC) => KeyFormat::RAW, in export_key()
70 KeyParameterValue::Algorithm(Algorithm::RSA) in export_key()
71 | KeyParameterValue::Algorithm(Algorithm::EC) => KeyFormat::PKCS8, in export_key()
76 (KeyFormat::PKCS8, KeyParameterValue::Algorithm(Algorithm::EC)) => { in export_key()
81 KeyParameterValue::EcCurve(EcCurve::CURVE_25519) => key_material, in export_key()
82 KeyParameterValue::EcCurve(EcCurve::P_224) => { in export_key()
[all …]
Dkm_compat.rs28 KeyParameterValue::KeyParameterValue, KeyPurpose::KeyPurpose, SecurityLevel::SecurityLevel,
350 p.tag == Tag::EC_CURVE && p.value == KeyParameterValue::EcCurve(EcCurve::CURVE_25519) in emulation_required()
392 p.tag == Tag::PURPOSE && p.value == KeyParameterValue::KeyPurpose(KeyPurpose::AGREE_KEY) in emulation_required()
442 value: KeyParameterValue::KeyPurpose(KeyPurpose::SIGN), in test_keymintv1_emulation_required()
446 value: KeyParameterValue::KeyPurpose(KeyPurpose::VERIFY), in test_keymintv1_emulation_required()
455 value: KeyParameterValue::KeyPurpose(KeyPurpose::AGREE_KEY), in test_keymintv1_emulation_required()
464 value: KeyParameterValue::KeyPurpose(KeyPurpose::AGREE_KEY), in test_keymintv1_emulation_required()
468 value: KeyParameterValue::EcCurve(EcCurve::P_256), in test_keymintv1_emulation_required()
478 value: KeyParameterValue::KeyPurpose(KeyPurpose::AGREE_KEY), in test_keymintv1_emulation_required()
482 value: KeyParameterValue::EcCurve(EcCurve::CURVE_25519), in test_keymintv1_emulation_required()
[all …]
Dboot_level_keys.rs20 key_parameter::KeyParameterValue,
122 DenyLaterStrategy::EarlyBootOnly => KeyParameterValue::EarlyBootOnly, in get_level_zero_key()
123 DenyLaterStrategy::MaxUsesPerBoot => KeyParameterValue::MaxUsesPerBoot(1), in get_level_zero_key()
127 KeyParameterValue::Algorithm(Algorithm::HMAC).into(), in get_level_zero_key()
128 KeyParameterValue::Digest(Digest::SHA_2_256).into(), in get_level_zero_key()
129 KeyParameterValue::KeySize(256).into(), in get_level_zero_key()
130 KeyParameterValue::MinMacLength(256).into(), in get_level_zero_key()
131 KeyParameterValue::KeyPurpose(KeyPurpose::SIGN).into(), in get_level_zero_key()
132 KeyParameterValue::NoAuthRequired.into(), in get_level_zero_key()
161 KeyParameterValue::MacLength(256).into(), in get_level_zero_key()
[all …]
Denforcements.rs20 use crate::key_parameter::{KeyParameter, KeyParameterValue};
440 && *kp.key_parameter_value() != KeyParameterValue::Algorithm(Algorithm::EC) in authorize_create()
452 KeyParameterValue::Algorithm(Algorithm::RSA) in authorize_create()
453 | KeyParameterValue::Algorithm(Algorithm::EC) => { in authorize_create()
488 KeyParameterValue::NoAuthRequired => { in authorize_create()
491 KeyParameterValue::AuthTimeout(t) => { in authorize_create()
494 KeyParameterValue::HardwareAuthenticatorType(a) => { in authorize_create()
497 KeyParameterValue::KeyPurpose(p) => { in authorize_create()
503 KeyParameterValue::CallerNonce => { in authorize_create()
506 KeyParameterValue::ActiveDateTime(a) => { in authorize_create()
[all …]
Dkey_parameter.rs103 KeyParameterValue::KeyParameterValue as KmKeyParameterValue, KeyPurpose::KeyPurpose,
794 value: KeyParameterValue::$vname$((<$vtype as Default>::default()))?,
813 pub enum KeyParameterValue {
1034 impl From<&KmKeyParameter> for KeyParameterValue { implementation
1043 value: KeyParameterValue,
1051 pub fn new(value: KeyParameterValue, security_level: SecurityLevel) -> Self { in new() argument
1067 value: KeyParameterValue::new_from_sql(tag_val, data)?, in new_from_sql()
1078 pub fn key_parameter_value(&self) -> &KeyParameterValue { in key_parameter_value() argument
1167 check_field_matches_tag_type(&KeyParameterValue::make_field_matches_tag_type_test_vector()); in key_parameter_value_field_matches_tag_type()
1172 let params = KeyParameterValue::make_key_parameter_defaults_vector(); in key_parameter_serialization_test()
[all …]
Dremote_provisioning.rs24 KeyParameter::KeyParameter, KeyParameterValue::KeyParameterValue, SecurityLevel::SecurityLevel,
73 value: KeyParameterValue::Algorithm(Algorithm::RSA) in is_asymmetric_key()
76 value: KeyParameterValue::Algorithm(Algorithm::EC) in is_asymmetric_key()
Dsecurity_level.rs29 use crate::key_parameter::KeyParameterValue as KsKeyParamValue;
55 KeyParameterValue::KeyParameterValue, SecurityLevel::SecurityLevel, Tag::Tag,
298 KeyParameterValue::KeyPurpose(p) => Ok(p), in create_operation()
428 value: KeyParameterValue::DateTime( in add_required_parameters()
456 value: KeyParameterValue::Blob(aaid), in add_required_parameters()
475 value: KeyParameterValue::BoolValue(true), in add_required_parameters()
491 Some(KeyParameter { tag: _, value: KeyParameterValue::Algorithm(Algorithm::RSA) }) in add_required_parameters()
492 | Some(KeyParameter { tag: _, value: KeyParameterValue::Algorithm(Algorithm::EC) }) => { in add_required_parameters()
496 value: KeyParameterValue::DateTime(0), in add_required_parameters()
502 value: KeyParameterValue::DateTime(UNDEFINED_NOT_AFTER), in add_required_parameters()
[all …]
Ddatabase.rs50 use crate::key_parameter::{KeyParameter, KeyParameterValue, Tag};
2529 matches!(kp.key_parameter_value(), KeyParameterValue::UserSecureID(_)) in unbind_auth_bound_keys_for_user()
2880 KeyParameterValue::UserSecureID(sid) if *sid == secure_user_id in get_app_uids_affected_by_sid()
2903 KeyParameterValue, KeyPurpose, PaddingMode, SecurityLevel,
4498 KeyParameter::new(KeyParameterValue::Invalid, SecurityLevel::TRUSTED_ENVIRONMENT), in make_test_params_with_sids()
4500 KeyParameterValue::KeyPurpose(KeyPurpose::SIGN), in make_test_params_with_sids()
4504 KeyParameterValue::KeyPurpose(KeyPurpose::DECRYPT), in make_test_params_with_sids()
4508 KeyParameterValue::Algorithm(Algorithm::RSA), in make_test_params_with_sids()
4511 KeyParameter::new(KeyParameterValue::KeySize(1024), SecurityLevel::TRUSTED_ENVIRONMENT), in make_test_params_with_sids()
4513 KeyParameterValue::BlockMode(BlockMode::ECB), in make_test_params_with_sids()
[all …]
Dsuper_key.rs27 key_parameter::{KeyParameter, KeyParameterValue},
216 KeyParameterValue::Algorithm(Algorithm::AES), in decrypt()
217 KeyParameterValue::KeySize(256), in decrypt()
218 KeyParameterValue::BlockMode(BlockMode::GCM), in decrypt()
219 KeyParameterValue::PaddingMode(PaddingMode::NONE), in decrypt()
220 KeyParameterValue::Nonce(self.nonce.clone()), in decrypt()
221 KeyParameterValue::MacLength(128), in decrypt()
900 KeyParameterValue::Algorithm(Algorithm::AES), in lock_unlocked_device_required_keys()
901 KeyParameterValue::KeySize(256), in lock_unlocked_device_required_keys()
902 KeyParameterValue::BlockMode(BlockMode::GCM), in lock_unlocked_device_required_keys()
[all …]
Dutils.rs32 KeyParameter::KeyParameter as KmKeyParameter, KeyParameterValue::KeyParameterValue, Tag::Tag,
204 && (kp.value == KeyParameterValue::Algorithm(Algorithm::RSA) in import_keyblob_and_perform_op()
205 || (kp.value == KeyParameterValue::Algorithm(Algorithm::EC))) in import_keyblob_and_perform_op()
254 value: KeyParameterValue::DateTime(0), in import_keyblob_and_perform_op()
258 value: KeyParameterValue::DateTime(UNDEFINED_NOT_AFTER), in import_keyblob_and_perform_op()
Dlegacy_blob.rs20 key_parameter::{KeyParameter, KeyParameterValue},
544 pub fn read_key_parameters(stream: &mut &[u8]) -> Result<Vec<KeyParameterValue>> { in read_key_parameters() argument
566 let mut params: Vec<KeyParameterValue> = Vec::new(); in read_key_parameters()
571 KeyParameterValue::new_from_tag_primitive_pair( in read_key_parameters()
578 KeyParameterValue::new_from_tag_primitive_pair( in read_key_parameters()
586 KeyParameterValue::new_from_tag_primitive_pair(tag, 1) in read_key_parameters()
599 KeyParameterValue::new_from_tag_primitive_pair( in read_key_parameters()
Dlegacy_importer.rs22 use crate::key_parameter::{KeyParameter, KeyParameterValue};
798 KeyParameterValue::RollbackResistance == *kp.key_parameter_value() in bulk_delete()
/system/hardware/interfaces/wifi/keystore/1.0/default/
Dkeystore.cpp235 algorithm = element.keyParameter.value.get<KMV1::KeyParameterValue::algorithm>(); in keyStore2Sign()
249 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::keyPurpose>( in keyStore2Sign()
253 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::algorithm>(*algorithm)}; in keyStore2Sign()
256 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::paddingMode>( in keyStore2Sign()
261 KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::digest>(KMV1::Digest::NONE)}; in keyStore2Sign()
/system/security/keystore-engine/
Dkeystore2_engine.cpp206 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::keyPurpose>( in keystore2_sign()
210 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::algorithm>(algorithm)}; in keystore2_sign()
213 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::paddingMode>( in keystore2_sign()
217 .value = KMV1::KeyParameterValue::make<KMV1::KeyParameterValue::digest>( in keystore2_sign()
/system/security/keystore/
Dkeystore_cli_v2.cpp163 keymint::KeyParameterValue::make<keymint::KeyParameterValue::algorithm>( in verifyEncryptionKeyAttributes()
172 keymint::KeyParameterValue::make<keymint::KeyParameterValue::integer>( in verifyEncryptionKeyAttributes()
181 keymint::KeyParameterValue::make<keymint::KeyParameterValue::blockMode>( in verifyEncryptionKeyAttributes()
190 keymint::KeyParameterValue::make<keymint::KeyParameterValue::paddingMode>( in verifyEncryptionKeyAttributes()
204 keymint::KeyParameterValue::make<keymint::KeyParameterValue::algorithm>( in verifyAuthenticationKeyAttributes()
213 keymint::KeyParameterValue::make<keymint::KeyParameterValue::integer>( in verifyAuthenticationKeyAttributes()
222 keymint::KeyParameterValue::make<keymint::KeyParameterValue::integer>( in verifyAuthenticationKeyAttributes()
231 keymint::KeyParameterValue::make<keymint::KeyParameterValue::digest>( in verifyAuthenticationKeyAttributes()
/system/security/keystore2/tests/
Dkeystore2_client_test_utils.rs36 KeyParameterValue::KeyParameterValue, KeyPurpose::KeyPurpose, PaddingMode::PaddingMode,
352 if let KeyParameterValue::Blob(val) = &key_param.value { in get_op_nonce()

12