Retrieves an encrypted value associated with the key.
Note: This operation requires the user interaction, consider using ActivityManager.runUserInteraction to ensure that consequent UI-related operations are suspended until this one is completed.
Optional
config: BiometricConfigThe deciphered value, or null
if key wasn't found, or authentication has failed.
InvalidAlgorithmParameterException At least one biometric must be enrolled to create keys requiring user authentication for every use. Check BiometricManager.getBiometricStatus before reading the key.
KeyPermanentlyInvalidatedException Indicates that the key can no longer be read because it has been permanently invalidated (for example, because of the biometric enrollment). Set a new value or delete the key to recover from this error.
Associates a value with a key in an encrypted storage.
Note: This operation requires the user interaction, consider using ActivityManager.runUserInteraction to ensure that consequent UI-related operations are suspended until this one is completed.
A key to set.
A value to write.
Optional
config: BiometricConfigThe options of the biometric prompt.
true
if the value was written to the storage, or false
if authentication has failed.
InvalidAlgorithmParameterException At least one biometric must be enrolled to create keys requiring user authentication for every use. Check BiometricManager.getBiometricStatus before setting the key.
Deletes the key and the associated encrypted value.