tink-crypto / tink

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
https://developers.google.com/tink
Apache License 2.0
13.5k stars 1.18k forks source link

java.security.InvalidKeyException: Keystore cannot load the key with ID: _androidx_security_master_key_ #595

Closed Dahuoji-Coder closed 1 year ago

Dahuoji-Coder commented 2 years ago

java.security.InvalidKeyException: Keystore cannot load the key with ID: _androidx_security_masterkey

juergw commented 1 year ago

This is related to https://github.com/google/tink/issues/535. We don't have a clear solution for this. One thing you can try is to use a global lock.

juergw commented 1 year ago

I think this error was caused by a race-condition that should now be fixed in Tink version 1.8.0. For android security, there is the version 1.1.0-alpha05 that also fixes a similar race condition. Please upgrade to these vesions.

See https://github.com/tink-crypto/tink-java/releases/tag/v1.8.0 and https://developer.android.com/jetpack/androidx/releases/security.