Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

EncryptedFile.Builder

public static final class EncryptedFile.Builder
extends Object

java.lang.Object
   ↳ androidx.security.crypto.EncryptedFile.Builder


Builder class to configure EncryptedFile

Summary

Public constructors

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

Public methods

EncryptedFile build()
EncryptedFile.Builder setKeysetAlias(String keysetAlias)
EncryptedFile.Builder setKeysetPrefName(String keysetPrefName)

Inherited methods

Public constructors

EncryptedFile.Builder

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

Parameters
file File

context Context

masterKeyAlias String

fileEncryptionScheme EncryptedFile.FileEncryptionScheme

Public methods

build

public EncryptedFile build ()

Returns
EncryptedFile An EncryptedFile with the specified parameters.

Throws
GeneralSecurityException
IOException

setKeysetAlias

public EncryptedFile.Builder setKeysetAlias (String keysetAlias)

Parameters
keysetAlias String: The alias in the SharedPreferences file to store the keyset.

Returns
EncryptedFile.Builder This Builder

setKeysetPrefName

public EncryptedFile.Builder setKeysetPrefName (String keysetPrefName)

Parameters
keysetPrefName String: The SharedPreferences file to store the keyset.

Returns
EncryptedFile.Builder This Builder