EncryptedSharedPreferencesKt

public final class EncryptedSharedPreferencesKt


Summary

Public methods

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

Opens an instance of encrypted SharedPreferences

Public methods

EncryptedSharedPreferences

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

Opens an instance of encrypted SharedPreferences

Parameters
@NonNull String fileName

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

@NonNull MasterKey masterKey

The master key to use.

@NonNull EncryptedSharedPreferences.PrefKeyEncryptionScheme prefKeyEncryptionScheme

The scheme to use for encrypting keys.

@NonNull EncryptedSharedPreferences.PrefValueEncryptionScheme prefValueEncryptionScheme

The scheme to use for encrypting values.

Returns
SharedPreferences

The SharedPreferences instance that encrypts all data.