Im trying to integrate Fingerprint in one of my android applications.
To generate a key by user authentication i’m using the below code
KeyGenerator generator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES,"AndroidKeyStore");
generator.init(new KeyGenParameterSpec.Builder ("AndroidKeyStore",
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
.setBlockModes(KeyProperties.BLOCK_MODE_CBC)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
.setUserAuthenticationRequired(true)
.build()
);
generator.generateKey();
The issue I’m facing here is that the generator.init & generator.generateKey methods are taking some time to execute (~5 secs) in OS 8.0(Oreo) in Samsung devices.
The methods are executed good in rest of devices & OS versions.
Any one who can shed some light on this are greatly appreciated.
Thanks much.