Open AndroidDeveloperLB opened 4 years ago
I think this can be done as such:
val masterKey = MasterKey.Builder(context, MasterKey.DEFAULT_MASTER_KEY_ALIAS).setKeyScheme(MasterKey.KeyScheme.AES256_GCM).build()
And to get the sharedPreferences of it:
EncryptedSharedPreferences.create(context, fileName, masterKey,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
Seems MasterKeys.getOrCreate is deprecated. It says to use MasterKey.Builder instead:
Can you please update it?
Also, I think the minimal API for
androidx.security:security-crypto:1.1.0-alpha02
, is now 21.