Skip to content

Instantly share code, notes, and snippets.

@jetrubyshared
Created October 31, 2018 14:43
Show Gist options
  • Save jetrubyshared/3bd48402f894fd2a4d24fcb2399e9bf2 to your computer and use it in GitHub Desktop.
Save jetrubyshared/3bd48402f894fd2a4d24fcb2399e9bf2 to your computer and use it in GitHub Desktop.
try {
sKeyPairGenerator.initialize(new KeyGenParameterSpec.Builder(KEY_ALIAS,
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
.setDigests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_OAEP)
.setUserAuthenticationRequired(true)
.build());
sKeyPairGenerator.generateKeyPair();
return true;
} catch (InvalidAlgorithmParameterException e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment