When trying to use the SecureCredentialsManager in a device without Lock Screen set (no fingerprint, no pin, no password, no pattern) the app crashes when trying to save a credential.
java.lang.IllegalStateException: Android keystore must be in initialized and unlocked state if encryption is required at android.security.AndroidKeyPairGenerator.generateKeyPair(AndroidKeyPairGenerator.java:84) at java.security.KeyPairGenerator$KeyPairGeneratorImpl.generateKeyPair(KeyPairGenerator.java:276) at com.auth0.android.authentication.storage.CryptoUtil.getRSAKeyEntry(CryptoUtil.java:135) at com.auth0.android.authentication.storage.CryptoUtil.RSAEncrypt(CryptoUtil.java:184) at com.auth0.android.authentication.storage.CryptoUtil.getAESKey(CryptoUtil.java:212) at com.auth0.android.authentication.storage.CryptoUtil.encrypt(CryptoUtil.java:243) at com.auth0.android.authentication.storage.SecureCredentialsManager.saveCredentials(SecureCredentialsManager.java:146) at com.perxhealth.android.ui.activities.SplashActivity.onSuccessfulLogin(SplashActivity.kt:426)
When trying to use the SecureCredentialsManager in a device without Lock Screen set (no fingerprint, no pin, no password, no pattern) the app crashes when trying to save a credential.
java.lang.IllegalStateException: Android keystore must be in initialized and unlocked state if encryption is required at android.security.AndroidKeyPairGenerator.generateKeyPair(AndroidKeyPairGenerator.java:84) at java.security.KeyPairGenerator$KeyPairGeneratorImpl.generateKeyPair(KeyPairGenerator.java:276) at com.auth0.android.authentication.storage.CryptoUtil.getRSAKeyEntry(CryptoUtil.java:135) at com.auth0.android.authentication.storage.CryptoUtil.RSAEncrypt(CryptoUtil.java:184) at com.auth0.android.authentication.storage.CryptoUtil.getAESKey(CryptoUtil.java:212) at com.auth0.android.authentication.storage.CryptoUtil.encrypt(CryptoUtil.java:243) at com.auth0.android.authentication.storage.SecureCredentialsManager.saveCredentials(SecureCredentialsManager.java:146) at com.perxhealth.android.ui.activities.SplashActivity.onSuccessfulLogin(SplashActivity.kt:426)