MasterKeys


@RequiresApi(value = Build.VERSION_CODES.M)
class 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

Public functions

java-static String
getOrCreate(keyGenParameterSpec: KeyGenParameterSpec)

Creates or gets the master key provided

Constants

AES256_GCM_SPEC

Added in 1.0.0
Deprecated in 1.1.0-alpha07
const val AES256_GCM_SPECKeyGenParameterSpec

Public functions

getOrCreate

Added in 1.0.0
Deprecated in 1.1.0-alpha07
java-static fun getOrCreate(keyGenParameterSpec: KeyGenParameterSpec): String

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