Skip to content

Instantly share code, notes, and snippets.

@yakivmospan
Created November 20, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yakivmospan/499af447415a4921e3260e7f27c4c0be to your computer and use it in GitHub Desktop.
Save yakivmospan/499af447415a4921e3260e7f27c4c0be to your computer and use it in GitHub Desktop.
fun wrapKey(keyToBeWrapped: Key, keyToWrapWith: Key?): String {
cipher.init(Cipher.WRAP_MODE, keyToWrapWith)
val decodedData = cipher.wrap(keyToBeWrapped)
return Base64.encodeToString(decodedData, Base64.DEFAULT)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment