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

Handle KeyStoreException in Android 8.0 #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

damirarh
Copy link

@damirarh damirarh commented Feb 2, 2018

This exception is thrown in "verify" on Android 8.0 if new fingerprints were enrolled after "save" has been called. On Android 8.1 KeyPermanentlyInvalidatedException is thrown in the same scenario (but already in "has"), therefore I'm handling it the same - i.e. deleting the key so that it will be recreated on next call.

When the application receives this error (KeyPermanentlyInvalidatedException), it should reinitialize the fingerprint usage - the user will have to reenter the password and agree to store it using the fingerprint.

This exception is thrown in "verify" on Android 8.0 if new fingerprints were enrolled after "save" has been called. On Android 8.1 KeyPermanentlyInvalidatedException is thrown in the same scenario (but already in "has"), therefore I'm handling it the same - i.e. deleting the key so that it will be recreated on next call.

When the application receives this error (KeyPermanentlyInvalidatedException), it should reinitialize the fingerprint usage - the user will have to reenter the password and agree to store it using the fingerprint.
@SleimanB
Copy link

SleimanB commented May 1, 2018

Hello @damirarh, I don't know why your code didn't work for me, when i use .save() method error exception "Failed to encrypt the data with the generated key: IllegalBlockSizeException: null"
same issue. any help ?

@damirarh
Copy link
Author

damirarh commented May 1, 2018

@SleimanB Did you check what was the cause in the thrown exception using the code I added to extract it? Is it the same exception/message as I am checking for in my code, i.e. Key user not authenticated?

sykaeh pushed a commit to ergon/cordova-plugin-keychain-touch-id that referenced this pull request Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants