android.security.KeyStoreException
hsseo opened this issue · 3 comments
I am using KeyAttestation well.
I have one question.
I have a problem when I proceed as follows on a specific device.
val builder = KeyGenParameterSpec.Builder(alias, purposes)
.setAlgorithmParameterSpec(ECGenParameterSpec("secp256r1"))
.setDigests(KeyProperties.DIGEST_SHA256)
.setCertificateNotBefore(now)
.setAttestationChallenge(now.toString().toByteArray())
val keyPairGenerator = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore")
keyPairGenerator.initialize(builder.build())
keyPairGenerator.generateKeyPair()
KeyStore Exception occurs in keyPairGenerator.generateKeyPair().
The exception contents are as follows.
android.security.KeyStoreException: -74 (internal Keystore code: -74 message: In generate_key.
Caused by:
0: While generating Key without explicit attestation key.
1: Error::Km(ErrorCode(-74))) (public error code: 10 internal Keystore code: -74)
KeyStoreException occurs due to the .setAttestationChallenge(now.toString().toByteArray()) part.
Can I get some help in this regard?
-74: ATTESTATION_KEYS_NOT_PROVISIONED
Thanks to reply
Why does the ATTESTATION_KEYS_NOT_PROVISIONED error occur?
It works fine on other devices, but not on this device.
Same Problem in device xiaomi 14 with Xiaomi HyperOS (Android 14) System