问题
I am working on the fingerprint authentication for android app. In which I have done with the authentication related part. Now I am doing the research to identify weather the user has added a new fingerprint, edit or delete the fingerprint from the device. But i didn't find any resource which helps me to identify this.
So, if anyone can help me how to identify this, it will be very helpful to me.
回答1:
KeyPermanentlyInvalidatedException would be thrown when the SecretKey is used, if a new fingerprint is added or all the fingerprints are removed after the key was created. But from what I've seen, only a bunch of Samsung devices actually throw this exception. So it probably is not reliable enough if you want to know any change in the enrolled fingerprints across all devices.
If you're concerned about the security side of things, check out the setInvalidatedByBiometricEnrollment method which is available on N and above.
回答2:
https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder.html#setInvalidatedByBiometricEnrollment(boolean)
https://android.googlesource.com/platform/frameworks/base/+/7ea5090/keystore/java/android/security/KeyPermanentlyInvalidatedException.java
Refer This Links. from what I've seen, only a bunch of Samsung devices actually throw this exception. So it probably is not reliable enough if you want to know any change in the enrolled fingerprints across all devices.
来源:https://stackoverflow.com/questions/41996310/how-to-identify-fingerprint-is-add-edit-deleted-from-the-android-device