We can enhance the existing manager to make it encrypt/decrypt the content before persisting it. Then as an extra improvement, we can ask for user authentication before allowing them to obtain the credentials.
- API 18 introduces the algorithm I'm using to encrypt/decrypt.
- API 21 introduces the Intent to call the LockScreen and wait for a cancel/pass signal.
- API 23 introduces the protected keys, which means that in every key use we can ask for the user to be authenticated first.
The CredentialsManager
usage can be divided in two: