MasterKey
class MasterKey
Wrapper for a master key used in the library.
On Android M (API 23) and above, this is class references a key that's stored in the Android Keystore. On Android L (API 21, 22), there isn't a master key.
Summary
Nested types |
|---|
class MasterKey.BuilderThis class is deprecated. Use |
enum MasterKey.KeySchemeThis enum is deprecated. Use |
Constants |
|
|---|---|
const Int |
This property is deprecated. Use |
const String! |
DEFAULT_MASTER_KEY_ALIAS = "_androidx_security_master_key_"This property is deprecated. Use |
Public functions |
|
|---|---|
java-static Int |
The default validity period for authentication in seconds. |
Int |
Gets the duration in seconds that the key is unlocked for following user authentication. |
Boolean |
Checks if this key is backed by the Android Keystore. |
Boolean |
Gets whether the key is backed by strong box. |
Boolean |
Gets whether user authentication is required to use this key. |
String |
|
Constants
const val DEFAULT_AES_GCM_MASTER_KEY_SIZE = 256: Int
The default and recommended size for the master key.
const val DEFAULT_MASTER_KEY_ALIAS = "_androidx_security_master_key_": String!
The default master key alias.
Public functions
java-static fungetDefaultAuthenticationValidityDurationSeconds(): Int
The default validity period for authentication in seconds.
fungetUserAuthenticationValidityDurationSeconds(): Int
Gets the duration in seconds that the key is unlocked for following user authentication.
The value returned for this method is only meaningful on Android M+ (API 23) when isUserAuthenticationRequired returns true.
| Returns | |
|---|---|
Int |
The duration the key is unlocked for in seconds. |
funisKeyStoreBacked(): Boolean
Checks if this key is backed by the Android Keystore.
| Returns | |
|---|---|
Boolean |
|
funisUserAuthenticationRequired(): Boolean
Gets whether user authentication is required to use this key.
This method always returns false on Android L (API 21 + 22).