Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deleting default keystore entry #78

Open
xdgimf opened this issue Dec 29, 2017 · 0 comments
Open

Add support for deleting default keystore entry #78

xdgimf opened this issue Dec 29, 2017 · 0 comments

Comments

@xdgimf
Copy link

xdgimf commented Dec 29, 2017

Right now you can only delete the secretKey but not the default keystore entry. This is useful for app that has optional fingerprint feature where user can turn it off anytime. When the user turn off the fingerprint feature we should delete the secretKey and keystore entry.

Deleting the keystore entry is easy to implement but we need something more convenient. I think we should include it in this library.

Its already implemented in CipherProvider.

private static void removeKey(String keyName) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException {
  if (keyExists(keyName)) {
    KeyStore keyStore = KeyStore.getInstance(ANDROID_KEY_STORE);
    keyStore.load(null);
    keyStore.deleteEntry(keyName);
  }
}

I propose something like:

RxFingerprint.removeKey() // Default KeyName
RxFingerprint.removeKey("CUSTOMKEY") // Custom KeyName

What do you guys think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants