I am trying to follow examples given here: https://developer.android.com/topic/security/data
I have included the required libraries in my gradle:
implementation "androidx.security:security-crypto:1.0.0"
// For Identity Credential APIs
implementation "androidx.security:security-identity-credential:1.0.0-alpha02"
And yet when I try to use the code:
val mainKey = MasterKey.Builder(applicationContext)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
I get unresolved reference: MasterKey error. Does the library have that class at all?
Thanks in advance.
Upgrade the library to latest version (1.1.0-alpha03 at the time of this writing)
implementation "androidx.security:security-crypto:1.1.0-alpha03"
From the release note, MasterKey is added on Version 1.1.0-alpha01.
Version 1.1.0-alpha01
...
New MasterKey class provides more options for keys, also deprecating MasterKeys to support new features and versions of Android that do not have KeyGenParamSpec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With