Created
June 26, 2019 08:14
-
-
Save BDOMDev/cd5208b5c6d0991fa3b17868d87a7e1e to your computer and use it in GitHub Desktop.
Save a Secret key to sharedPreference
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
fun saveSecretKey(sharedPref: SharedPreferences, secretKey: SecretKey): String { | |
val encodedKey = Base64.encodeToString(secretKey.encoded, Base64.NO_WRAP) | |
sharedPref.edit().putString(AppConstants.secretKeyPref, encodedKey).apply() | |
return encodedKey | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment