Skip to content

Instantly share code, notes, and snippets.

@BDOMDev
Created June 26, 2019 08:14
Show Gist options
  • Save BDOMDev/cd5208b5c6d0991fa3b17868d87a7e1e to your computer and use it in GitHub Desktop.
Save BDOMDev/cd5208b5c6d0991fa3b17868d87a7e1e to your computer and use it in GitHub Desktop.
Save a Secret key to sharedPreference
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