Fatal Exception: java.lang.RuntimeException: Unable to create application {packageName}: java.security.InvalidKeyException: Keystore operation failed
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7593)
at android.app.ActivityThread.access$1700(ActivityThread.java:315)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2286)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by java.security.InvalidKeyException: Keystore operation failed
at android.security.keystore2.KeyStoreCryptoOperationUtils.getInvalidKeyException(KeyStoreCryptoOperationUtils.java:130)
at android.security.keystore2.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:154)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:345)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:177)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2984)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2891)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2796)
at javax.crypto.Cipher.chooseProvider(Cipher.java:773)
at javax.crypto.Cipher.init(Cipher.java:1143)
at javax.crypto.Cipher.init(Cipher.java:1084)
at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.encryptInternal(AndroidKeystoreAesGcm.java:85)
at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.encrypt(AndroidKeystoreAesGcm.java:73)
at com.google.crypto.tink.integration.android.AndroidKeystoreKmsClient.validateAead(AndroidKeystoreKmsClient.java:298)
at com.google.crypto.tink.integration.android.AndroidKeystoreKmsClient.getAead(AndroidKeystoreKmsClient.java:180)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readMasterkeyDecryptAndParseKeyset(AndroidKeysetManager.java:365)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:297)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:169)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:130)
at com.navercorp.nid.preference.EncryptedPreferences.createSharedPreferences(EncryptedPreferences.kt:59)
at com.navercorp.nid.preference.EncryptedPreferences.init(EncryptedPreferences.kt:49)
at com.navercorp.nid.preference.EncryptedPreferences.access$init(EncryptedPreferences.kt:18)
at com.navercorp.nid.preference.EncryptedPreferences$encryptedPreferences$2.invoke(EncryptedPreferences.kt:31)
at com.navercorp.nid.preference.EncryptedPreferences$encryptedPreferences$2.invoke(EncryptedPreferences.kt:30)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.navercorp.nid.preference.EncryptedPreferences.getEncryptedPreferences(EncryptedPreferences.kt:30)
at com.navercorp.nid.preference.EncryptedPreferences.get(EncryptedPreferences.kt:111)
at com.navercorp.nid.oauth.NidOAuthPreferencesManager.getClientId(NidOAuthPreferencesManager.kt:54)
at com.navercorp.nid.preference.EncryptedPreferences.migration(EncryptedPreferences.kt:137)
at com.navercorp.nid.preference.EncryptedPreferences.setContext(EncryptedPreferences.kt:71)
at com.navercorp.nid.NaverIdLoginSDK.initialize(NaverIdLoginSDK.kt:86)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7588)
at android.app.ActivityThread.access$1700(ActivityThread.java:315)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2286)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by android.security.KeyStoreException: Invalid key blob
at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:408)
at android.security.KeyStoreSecurityLevel.createOperation(KeyStoreSecurityLevel.java:122)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:340)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:177)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2984)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2891)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2796)
at javax.crypto.Cipher.chooseProvider(Cipher.java:773)
at javax.crypto.Cipher.init(Cipher.java:1143)
at javax.crypto.Cipher.init(Cipher.java:1084)
at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.encryptInternal(AndroidKeystoreAesGcm.java:85)
at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.encrypt(AndroidKeystoreAesGcm.java:73)
at com.google.crypto.tink.integration.android.AndroidKeystoreKmsClient.validateAead(AndroidKeystoreKmsClient.java:298)
at com.google.crypto.tink.integration.android.AndroidKeystoreKmsClient.getAead(AndroidKeystoreKmsClient.java:180)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readMasterkeyDecryptAndParseKeyset(AndroidKeysetManager.java:365)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:297)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:169)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:130)
at com.navercorp.nid.preference.EncryptedPreferences.createSharedPreferences(EncryptedPreferences.kt:59)
at com.navercorp.nid.preference.EncryptedPreferences.init(EncryptedPreferences.kt:49)
at com.navercorp.nid.preference.EncryptedPreferences.access$init(EncryptedPreferences.kt:18)
at com.navercorp.nid.preference.EncryptedPreferences$encryptedPreferences$2.invoke(EncryptedPreferences.kt:31)
at com.navercorp.nid.preference.EncryptedPreferences$encryptedPreferences$2.invoke(EncryptedPreferences.kt:30)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.navercorp.nid.preference.EncryptedPreferences.getEncryptedPreferences(EncryptedPreferences.kt:30)
at com.navercorp.nid.preference.EncryptedPreferences.get(EncryptedPreferences.kt:111)
at com.navercorp.nid.oauth.NidOAuthPreferencesManager.getClientId(NidOAuthPreferencesManager.kt:54)
at com.navercorp.nid.preference.EncryptedPreferences.migration(EncryptedPreferences.kt:137)
at com.navercorp.nid.preference.EncryptedPreferences.setContext(EncryptedPreferences.kt:71)
at com.navercorp.nid.NaverIdLoginSDK.initialize(NaverIdLoginSDK.kt:86)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7588)
at android.app.ActivityThread.access$1700(ActivityThread.java:315)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2286)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Bug Report
재현 환경
사용중인 네아로 SDK 버전
Android 버전
재현되는 기기 모델명
이슈
이슈 명세
기대한 결과
실제 결과
재현 시나리오
Stack trace
Reference