Created
July 26, 2020 04:39
-
-
Save dinorahto/709d0811492d42f3eb11cb677f0819d4 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
val spec = KeyGenParameterSpec.Builder( | |
KEY_NAME, | |
KeyProperties.PURPOSE_ENCRYPT or | |
KeyProperties.PURPOSE_DECRYPT | |
).apply { | |
setBlockModes(KeyProperties.BLOCK_MODE_CBC) | |
setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) | |
setUserAuthenticationRequired(true) | |
setUserAuthenticationValidityDurationSeconds(TIMEOUT_SECONDS) | |
setRandomizedEncryptionRequired(false) | |
}.build() | |
val masterKeyAlias = MasterKeys.getOrCreate(spec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment