ophio / secure-preferences

Android secure shared preferences using Android Keystore system
https://medium.com/@vashisthg/android-secure-shared-preferences-10f8356a4c2b
Apache License 2.0
348 stars 56 forks source link

Deprecated code after Android M #19

Closed fcduarte closed 2 years ago

fcduarte commented 8 years ago

Hi guys,

any plans to fix those deprecated methods?

KeyStoreKeyGenerator

SecretKeyWrapper

I'm just wondering what would be the best way to fix it.

Best,

ragdroid commented 8 years ago

For KeyStoreKeyGenerator, maybe we can do something like this below :

boolean isHardwareSecured;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
    isHardwareSecured = KeyChain.isBoundKeyAlgorithm(algorithm);
} else {
    isHardwareSecured = keyInfo.isInsideSecureHardware();
}

More info

and something similar with KeyGenParameterSpec cc @vashisthg @fcduarte

ragdroid commented 8 years ago

@vashisthg https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.html

This might help us.