Skip to content

Instantly share code, notes, and snippets.

@yakivmospan
Last active December 3, 2017 23:45
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/a3994ba1ff317a90937cc0a7b8f233aa to your computer and use it in GitHub Desktop.
Save yakivmospan/a3994ba1ff317a90937cc0a7b8f233aa to your computer and use it in GitHub Desktop.
// On Marshmallow and higher (API 23+)
val builder = KeyGenParameterSpec.Builder(alias, KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT)
builder.setKeySize(1024)
// On Kitkat and up to Marshmallow (API 19 - 22)
val builder = KeyPairGeneratorSpec.Builder(context)
builder.setKeySize(1024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment