Created
February 3, 2023 18:40
-
-
Save tdcolvin/f03d18c33cef6fa2cfd0f74924db6611 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val encryptedFile by lazy { | |
//This is the app's internal storage folder | |
val baseDir = getApplication<Application>().filesDir | |
//The encrypted file within the app's internal storage folder | |
val fileToWrite = File(baseDir, "encrypted-file.txt") | |
//Create the encrypted file | |
EncryptedFile.Builder( | |
fileToWrite, | |
getApplication(), | |
mainKeyAlias, | |
EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB | |
).build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment