MasterKeys

public final class MasterKeys
extends Object

java.lang.Object
   ↳ androidx.security.crypto.MasterKeys


Convenient methods to create and obtain master keys in Android Keystore.

The master keys are used to encrypt data encryption keys for encrypting files and preferences.

Summary

Fields

public static final KeyGenParameterSpec AES256_GCM_SPEC

Public constructors

MasterKeys()

Public methods

static String getOrCreate(KeyGenParameterSpec keyGenParameterSpec)

Creates or gets the master key provided The encryption scheme is required fields to ensure that the type of encryption used is clear to developers.

Inherited methods

Fields

AES256_GCM_SPEC

public static final KeyGenParameterSpec AES256_GCM_SPEC

Public constructors

MasterKeys

public MasterKeys ()

Public methods

getOrCreate

public static String getOrCreate (KeyGenParameterSpec keyGenParameterSpec)

Creates or gets the master key provided The encryption scheme is required fields to ensure that the type of encryption used is clear to developers.

Parameters
keyGenParameterSpec KeyGenParameterSpec: The key encryption scheme

Returns
String The key alias for the master key

Throws
GeneralSecurityException
IOException