This returns the time (from CLOCK_MONOTONIC_RAW) that the specified user
last authenticated using the given authenticator.
Bug: 303839446
Test: atest keystore2_client_tests
Change-Id: Idd4c477365ffa556b7985d1d926dfa554680ff28
- Generate an RSA/EC attested keys with attestation of the device's
identifiers. Test should succeed in generatating a attested key with
attestation of device identifier. Test might fail on devices which
doesn't support device id attestation with error response code
`CANNOT_ATTEST_IDS or INVALID_TAG`.
- Try to generate an attested key with attestation of invalid device's
identifiers. Test should fail with error response `CANNOT_ATTEST_IDS`
- Test to make sure `CANNOT_ATTEST_IDS` error code is returned while
trying to generate a key on a device which doesn't support
`FEATURE_DEVICE_ID_ATTESTATION`.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ib57c58d3ea89279eb69db342c3343b8d99ddc639
1. Generate RSA key and grant it to a user. In user context load the
key using `EVP_PKEY_from_keystore` and perform sign and verify
opeearions.
[keystore2_perofrm_crypto_op_using_keystore2_engine_rsa_key_success]
2. Generate EC key and grant it to a user. In user context load the
key using `EVP_PKEY_from_keystore` and perform sign and verify
operations.
[keystore2_perofrm_crypto_op_using_keystore2_engine_ec_key_success]
3. Generate RSA key and grant it to a user. Re-encode the certificate
as PEM and update the certificate using `updateSubcomponents`.
In user context load the key using `EVP_PKEY_from_keystore` and
perform sign and verify operations.
Bug: 201343811
Test: atest keystore2_client_tests
Change-Id: I7dafd598f4198e11103cd11695b2f67636f24755
- Build ASN.1 DER-encoded wrapped key material `SecureKeyWrapper`.
Import the wrapped key material. Test should create DER-encoded
wrapped key material and import the secure key successfully.
Imported key should be used perform crypto operation successfully.
- Build ASN.1 DER-encoded wrapped key material `SecureKeyWrapper` with
invalid AAD. Try to import the wrapped key material. Test should
create DER-encoded wrapped key material. Test should fail to import
the secure key with error code `VERIFICATION_FAILED`.
- Import wrapped AES key and use it for crypto operations. Test should
import wrapped key and user it for performing crypto operations
successfully.
- Import a key wihtout WRAP_KEY purpose and try to use it as wrapping
key while importing wrapped key. Test should fail to import wrapped
key with an error code `INCOMPATIBLE_PURPOSE`.
- Try to import wrapped key using non-existing wrapping key in Android
keystore. Test should fail to import wrapped key with an error code
`KEY_NOT_FOUND`.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ic9ed03b6f945bd41c4873f97a84c1658c284e918
- Test to import a RSA key and validate imported key parameters.
Perform an operation using imported key. Test should be able to
import the key and complete the operation successfully.
- Test to import a RSA key without specifying key size and public
expenent. Determine key-size and public exponent from key material.
Validate imported key parameters. Perform an operation using imported
key. Test should be able to import the key and complete the operation
successfully.
- Test to import a RSA key with incorrect key-size as import key
parameter. Test should fail to import a key with an error code
`IMPORT_PARAMETER_MISMATCH`.
- Test to import a RSA key with incorrect public exponent as import key
parameter. Test should fail to import a key with an error code
`IMPORT_PARAMETER_MISMATCH`.
- Test to import a RSA key with multiple pursposes [SIGN and ATTEST_KEY]
as import key parameters. Test should fail to import a key with an
error code `INCOMPATIBLE_PURPOSE`.
- Test to import a EC key without specifying curve. Determine ec-curve
from key material. Validate imported key parameters. Perform an
operation using imported key. Test should be able to import the key
and complete the operation successfully.
- Test to import a EC key with incorrect ec-curve as import key
parameter. Test should fail to import a key with an error code
`IMPORT_PARAMETER_MISMATCH`.
- Test to import a AES, 3DES and HMAC keys. Validate imported keys
parameters. Perform operations using imported keys. Test should
be able to import the key and complete the operation successfully.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ib90c05b93929b8b0e1d4cb9542f5b8493a116c39
- Generate EC/RSA attestation keys and use it for signing RSA and EC
keys. Test should be able to use the attest keys for signing the
generated keys successfully.
- Generate EC-CURVE_25519 attestation key and use it for signing RSA
key. Test should be able to generate RSA key with EC-CURVE_25519 key
as attestation key.
- Generate an asymmetric key which doesn't possess ATTEST_KEY purpose.
Use this key for attesting asymmetric key. It should fail to generate
key with incompatible purpose error.
- Generate a symmetric key. Try to use this symmetric key as attestation
key while generating asymmetric key. It should fail to generate a key
with system error.
- Try to generate symmetric key with valid attestation key,
attstation-challenge and attestation-app-id. Test should generate a
key without attestation record.
- Try to generate RSA/EC attestation keys with multiple purpose. Test
should fail to generate keys with incompatible purpose error code.
- Generate an attestation key and try to use it for signing a key
without providing attestation challenge. Test should fail with missing
attestation challenge error.
Note: These tests are executed on devices where
`android.hardware.keystore.app_attest_key` feature is enabled, otherwise
tests are skipped.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I4228dc5fe5e207995472c3425d5f2696ef95249f
Added SPDX-license-identifier-Apache-2.0 to:
keystore2/tests/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: I816f5ba7db5e359b97f1bd0222ca43eebacfc4d1
Creates multiple child procs and creates opearations in it and
parent proc waits for all child procs operations status, expects
one or more opearations to fail with backeend busy error.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I52f95a7cfd031d80c88bfc2ca478a26572f40150