Secured-Preference-Store icon indicating copy to clipboard operation
Secured-Preference-Store copied to clipboard

[FIXED] KeyStore exception android.os.ServiceSpecificException: (code 7)

Open ajdevy opened this issue 6 years ago • 3 comments

Fixed secure preferences initialization with Android KeyStore, as described in https://stackoverflow.com/questions/52024752/android-p-keystore-exception-android-os-servicespecificexception?rq=1

ajdevy avatar Nov 15 '18 06:11 ajdevy

@EdgarJan can you give a bit more details?

ajdevy avatar Dec 16 '18 11:12 ajdevy

@EdgarJan can you give a bit more details?

W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:144)
        at java.security.KeyStoreSpi.engineEntryInstanceOf(KeyStoreSpi.java:583)
        at java.security.KeyStore.entryInstanceOf(KeyStore.java:1631)
        at devliving.online.securedpreferencestore.EncryptionManager.loadKey(EncryptionManager.java:690)
        at devliving.online.securedpreferencestore.EncryptionManager.setup(EncryptionManager.java:228)
        at devliving.online.securedpreferencestore.EncryptionManager.<init>(EncryptionManager.java:201)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.<init>(SecuredPreferenceStore.java:79)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:134)

I suggest remove check for mStore.entryInstanceOf(AES_KEY_ALIAS, KeyStore.SecretKeyEntry.class).

EdgarJan avatar Dec 16 '18 19:12 EdgarJan

Why is this not merged already?

BlueHeisenberg avatar Mar 15 '20 16:03 BlueHeisenberg