I am looking to understand the Google keystore for storing passwords on a device. ( https://developer.android.com/training/articles/keystore.html )
This article says: "Use the Keystore Android provider to allow a single application to store its own credentials that only the application can access." This is exactly what I want.
So, I think this will work like this: 1) I will create an RSA key
2) Store PrivateKey in KeyStore
3) Store PublicKey in some SharePrefs
4) Encrypt password using PublicKey
5) Encrypt the password using PrivateKey.
However, I think I'm misunderstanding something, because this article does not show
1) How to save PrivateKey in KeyStore (I do not see API showing how the keystore added the key)
2) Does not show how to decrypt data using PrivateKey
Baby, why this article says "Use PrivateKey in KeyStore to create a signature on some data." What does it mean to create a signature on some data ??? (I want to decrypt data using PrivateKey). And why does he want to verify the "signature previously made by PrivateKey".
So, I got lost at this moment ... this article started me in the right place, but then towards the end I got confused about what she was trying to achieve.
Can anyone suggest that what I'm trying to do makes any sense? Or should I just keep the public and private key in my own db? (there is not much security there, but its the best I can do with the given requirement of storing the password on the device).
Thank you very much
Rgds !!!!