EncryptedFile.Builder


class EncryptedFile.Builder


Builder class to configure EncryptedFile

Summary

Public constructors

Builder(
    context: Context,
    file: File,
    masterKey: MasterKey,
    fileEncryptionScheme: EncryptedFile.FileEncryptionScheme
)

Builder for an EncryptedFile.

Builder(
    file: File,
    context: Context,
    masterKeyAlias: String,
    fileEncryptionScheme: EncryptedFile.FileEncryptionScheme
)

This function is deprecated.

Use Builder instead.

Public constructors

Builder

Added in 1.1.0-alpha07
Builder(
    context: Context,
    file: File,
    masterKey: MasterKey,
    fileEncryptionScheme: EncryptedFile.FileEncryptionScheme
)

Builder for an EncryptedFile.

Builder

Added in 1.0.0
Deprecated in 1.1.0-alpha07
Builder(
    file: File,
    context: Context,
    masterKeyAlias: String,
    fileEncryptionScheme: EncryptedFile.FileEncryptionScheme
)

Builder for an EncryptedFile.

If the masterKeyAlias used here is for a key that is not yet created, this method will not be thread safe. Use the alternate signature that is not deprecated for multi-threaded contexts.

Public functions

build

Added in 1.0.0
fun build(): EncryptedFile
Returns
EncryptedFile

An EncryptedFile with the specified parameters.

setKeysetAlias

Added in 1.0.0
fun setKeysetAlias(keysetAlias: String): EncryptedFile.Builder
Parameters
keysetAlias: String

The alias in the SharedPreferences file to store the keyset.

Returns
EncryptedFile.Builder

This Builder

setKeysetPrefName

Added in 1.0.0
fun setKeysetPrefName(keysetPrefName: String): EncryptedFile.Builder
Parameters
keysetPrefName: String

The SharedPreferences file to store the keyset.

Returns
EncryptedFile.Builder

This Builder