List of usage examples for android.security.keystore KeyProperties DIGEST_SHA512
String DIGEST_SHA512
To view the source code for android.security.keystore KeyProperties DIGEST_SHA512.
Click Source Link
From source file:Main.java
@TargetApi(Build.VERSION_CODES.M) private static void generateNewKey() { try {//from w w w.j a v a 2 s . c o m KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_RSA, KEY_PROVIDER); keyPairGenerator.initialize(new KeyGenParameterSpec.Builder(KEY_ALIAS, KeyProperties.PURPOSE_DECRYPT) .setDigests(KeyProperties.DIGEST_SHA256, KeyProperties.DIGEST_SHA512) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_OAEP).build()); keyPairGenerator.generateKeyPair(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchProviderException e) { e.printStackTrace(); } catch (InvalidAlgorithmParameterException e) { e.printStackTrace(); } }