Last active
July 4, 2017 00:41
-
-
Save d0nutptr/88f80a329b40790a4ac0456434bfe8da to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| KeyGenerator generator = KeyGenerator.getInstance("AES", "AndroidKeyStore"); | |
| generator.init(new KeyGenParameterSpec.Builder("MyEncryptionKey", KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) | |
| .setBlockModes(KeyProperties.BLOCK_MODE_GCM) | |
| .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) | |
| .setRandomizedEncryptionRequired(true) | |
| .setKeySize(256) | |
| .build(), new SecureRandom()); | |
| generator.generateKey(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment