Created
June 9, 2020 22:40
-
-
Save shafty023/3c0e30789ca438abefe5635b6ba70aa3 to your computer and use it in GitHub Desktop.
Wrapper function to create a new key
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 lateinit var rawByteKey: ByteArray | |
private lateinit var dbCharKey: CharArray | |
/** | |
* Generates a new database key. | |
*/ | |
fun createNewKey() { | |
// This is the raw key that we'll be encrypting + storing | |
rawByteKey = generateRandomKey() | |
// This is the key that will be used by Room | |
dbCharKey = rawByteKey.toHex() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment