@RequiresApi(Build.VERSION_CODES.M)
  private static void generateNewAesGcmKeyWithoutExistenceCheck(String keyUri)
      throws GeneralSecurityException {
    String keyId = Validators.validateKmsKeyUriAndRemovePrefix(PREFIX, keyUri);
    KeyGenerator keyGenerator =
        KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");
    KeyGenParameterSpec spec =
        new KeyGenParameterSpec.Builder(
                keyId, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
            .setKeySize(256)
            .setBlockModes(KeyProperties.BLOCK_MODE_GCM)
            .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
            .build();
    keyGenerator.init(spec);
    keyGenerator.generateKey();
  }
Generates a new AES256-GCM key in Android Keystore.

<p>This function does not check if the key already exists, and will overwrite any existing key.
java_src/src/main/java/com/google/crypto/tink/integration/android/AndroidKeystoreKmsClient.java