androidx.security.crypto
Classes
EncryptedFile |
Class used to create and read encrypted files. |
EncryptedSharedPreferences |
An implementation of |
MasterKey |
Wrapper for a master key used in the library. |
MasterKeys |
Convenient methods to create and obtain master keys in Android Keystore. |
Top-level functions summary
EncryptedFile |
EncryptedFile(context: Context, file: File, masterKey: MasterKey, fileEncryptionScheme: EncryptedFile.FileEncryptionScheme = FileEncryptionScheme.AES256_GCM_HKDF_4KB, keysetPrefName: String? = null, keysetAlias: String? = null) Creates an EncryptedFile |
SharedPreferences |
EncryptedSharedPreferences(: Context, : String, : MasterKey, : EncryptedSharedPreferences.PrefKeyEncryptionScheme = PrefKeyEncryptionScheme.AES256_SIV, : EncryptedSharedPreferences.PrefValueEncryptionScheme = PrefValueEncryptionScheme.AES256_GCM) Opens an instance of encrypted SharedPreferences |
MasterKey |
MasterKey(context: Context, keyAlias: String = MasterKey.DEFAULT_MASTER_KEY_ALIAS, keyScheme: MasterKey.KeyScheme = MasterKey.KeyScheme.AES256_GCM, authenticationRequired: Boolean = false, userAuthenticationValidityDurationSeconds: Int = MasterKey.getDefaultAuthenticationValidityDurationSeconds(), requestStrongBoxBacked: Boolean = false) Creates a MasterKey with the provided parameters. |
Top-level functions
EncryptedFile
fun EncryptedFile(
context: Context,
file: File,
masterKey: MasterKey,
fileEncryptionScheme: EncryptedFile.FileEncryptionScheme = FileEncryptionScheme.AES256_GCM_HKDF_4KB,
keysetPrefName: String? = null,
keysetAlias: String? = null
): EncryptedFile
Creates an EncryptedFile
Parameters | |
---|---|
context: Context | The context to work with. |
file: File | The backing File. |
masterKey: MasterKey | The MasterKey that should be used. |
fileEncryptionScheme: EncryptedFile.FileEncryptionScheme = FileEncryptionScheme.AES256_GCM_HKDF_4KB | The FileEncryptionScheme to use, defaulting to FileEncryptionScheme.AES256_GCM_HKDF_4KB. |
keysetPrefName: String? = null | The SharedPreferences file to store the keyset for this EncryptedFile. |
keysetAlias: String? = null | The alias in the SharedPreferences file to store the keyset for this
EncryptedFile. |
EncryptedSharedPreferences
fun EncryptedSharedPreferences(
: Context,
: String,
: MasterKey,
: EncryptedSharedPreferences.PrefKeyEncryptionScheme = PrefKeyEncryptionScheme.AES256_SIV,
: EncryptedSharedPreferences.PrefValueEncryptionScheme = PrefValueEncryptionScheme.AES256_GCM
): SharedPreferences
Opens an instance of encrypted SharedPreference