Skip to content

java.lang.IllegalStateException: Android keystore must be in initialized and unlocked state if encryption is required #216

@francoj11

Description

@francoj11

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions