Merge "docs: Fixed key generator initialize method call." into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a1150e90e0
@@ -195,7 +195,7 @@ import javax.security.auth.x500.X500Principal;
|
|||||||
* <pre> {@code
|
* <pre> {@code
|
||||||
* KeyGenerator keyGenerator = KeyGenerator.getInstance(
|
* KeyGenerator keyGenerator = KeyGenerator.getInstance(
|
||||||
* KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");
|
* KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");
|
||||||
* keyGenerator.initialize(
|
* keyGenerator.init(
|
||||||
* new KeyGenParameterSpec.Builder("key2",
|
* new KeyGenParameterSpec.Builder("key2",
|
||||||
* KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
|
* KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
|
||||||
* .setBlockModes(KeyProperties.BLOCK_MODE_GCM)
|
* .setBlockModes(KeyProperties.BLOCK_MODE_GCM)
|
||||||
@@ -219,7 +219,7 @@ import javax.security.auth.x500.X500Principal;
|
|||||||
* <pre> {@code
|
* <pre> {@code
|
||||||
* KeyGenerator keyGenerator = KeyGenerator.getInstance(
|
* KeyGenerator keyGenerator = KeyGenerator.getInstance(
|
||||||
* KeyProperties.KEY_ALGORITHM_HMAC_SHA256, "AndroidKeyStore");
|
* KeyProperties.KEY_ALGORITHM_HMAC_SHA256, "AndroidKeyStore");
|
||||||
* keyGenerator.initialize(
|
* keyGenerator.init(
|
||||||
* new KeyGenParameterSpec.Builder("key2", KeyProperties.PURPOSE_SIGN).build());
|
* new KeyGenParameterSpec.Builder("key2", KeyProperties.PURPOSE_SIGN).build());
|
||||||
* SecretKey key = keyGenerator.generateKey();
|
* SecretKey key = keyGenerator.generateKey();
|
||||||
* Mac mac = Mac.getInstance("HmacSHA256");
|
* Mac mac = Mac.getInstance("HmacSHA256");
|
||||||
|
|||||||
Reference in New Issue
Block a user