1

Wanted to know if there is a way to detect biometric change in Android without using the setInvalidatedByBiometricEnrollment https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder.html#setInvalidatedByBiometricEnrollment(boolean). We currently use this and have noticed that in few devices this fails with biometric not enrolled, even if the user has enrolled biometrics. It also fails with biometric not enrolled, on some Samsung device which have only face id and no fingerprint sensors. I haven't been able to find any other reliable way to detect this. Would appreciate some guidance. Thank you.

swdev123
  • 43
  • 5

1 Answers1

0

To check if any new biometric have been enrolled since you created your biometric-associated key, just create a cipher with that key and try to init the cipher. If any new biometrics have been enrolled, the init call should trigger a KeyPermanentlyInvalidatedException