EncryptedSharedPreferencesKt

public final class EncryptedSharedPreferencesKt


Summary

Public methods

static final @NonNull SharedPreferences
EncryptedSharedPreferences(
    Context context,
    String fileName,
    MasterKey masterKey,
    EncryptedSharedPreferences.PrefKeyEncryptionScheme prefKeyEncryptionScheme,
    EncryptedSharedPreferences.PrefValueEncryptionScheme prefValueEncryptionScheme
)

Opens an instance of encrypted SharedPreferences

Public methods

EncryptedSharedPreferences

public static final @NonNull SharedPreferences EncryptedSharedPreferences(
    Context context,
    String fileName,
    MasterKey masterKey,
    EncryptedSharedPreferences.PrefKeyEncryptionScheme prefKeyEncryptionScheme,
    EncryptedSharedPreferences.PrefValueEncryptionScheme prefValueEncryptionScheme
)

Opens an instance of encrypted SharedPreferences

Parameters
String fileName

The name of the file to open; can not contain path separators.

MasterKey masterKey

The master key to use.

EncryptedSharedPreferences.PrefKeyEncryptionScheme prefKeyEncryptionScheme

The scheme to use for encrypting keys.

EncryptedSharedPreferences.PrefValueEncryptionScheme prefValueEncryptionScheme

The scheme to use for encrypting values.

Returns
@NonNull SharedPreferences

The SharedPreferences instance that encrypts all data.