How to generate KeyPair in android KeyStore protected by user password

I have an application that uses fingerprint and 4-digit output (which can be set by the user in the application settings, this is not a system authorization / template / password).

The fingerprint is okay, I have a problem with the pin.

What I'm trying to do is:

  • Allow user to set PIN from app settings
  • Generate Keypair in the keystore for some alias protected by the input output (so access to the private key without this output)
  • Send the public key to the server for future signature verification
  • Get the user token from the server and save it in local storage

Then during authorization:

  1. Ask user to enter PIN
  2. Get the secret key by pressing the button
  3. 6
  4. , , .

: KeyPair, PIN-,

P.S. fingerprint :

KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_SIGN).setUserAuthenticationRequired(true)
+4
1
0

Source: https://habr.com/ru/post/1660498/


All Articles