J'ai un token d'accès depuis le serveur après authentification, disons "uyhjjfjfgg567f8fhjkkf"
maintenant je veux le sauvegarder dans l'appareil en toute sécurité. J'ai regardé dans Keystore et Keychain dans les sites de développement Android. Je ne comprends pas clairement comment cela fonctionne et comment nous devrions récupérer le jeton du keystore.Comment enregistrer le token Oauth Access en toute sécurité en android
KeyPairGenerator kpg = KeyPairGenerator.getInstance(
KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore");
kpg.initialize(new KeyGenParameterSpec.Builder(
alias,
KeyProperties.PURPOSE_SIGN | KeyProperties.PURPOSE_VERIFY)
.setDigests(KeyProperties.DIGEST_SHA256,
KeyProperties.DIGEST_SHA512)
.build());
KeyPair kp = kpg.generateKeyPair();
/*
* Load the Android KeyStore instance using the the
* "AndroidKeyStore" provider to list out what entries are
* currently stored.
*/
KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
ks.load(null);
Enumeration<String> aliases = ks.aliases();