Builder

class Builder
kotlin.Any
   ↳ android.security.KeyStoreParameter.Builder

Builder class for KeyStoreParameter objects.

This will build protection parameters for use with the Android KeyStore facility.

This can be used to require that KeyStore entries be stored encrypted.

Example:

 KeyStoreParameter params = new KeyStoreParameter.Builder(mContext) .setEncryptionRequired() .build(); 

Requires API level 18 (Android 4.3, Jelly Bean)

Summary

Public constructors
<init>(context: Context)

Creates a new instance of the Builder with the given context.

Public methods
KeyStoreParameter.Builder

This class was deprecated in API level 21.

KeyStoreParameter

This class was deprecated in API level 21.

Public constructors

<init>

Builder(context: Context)

Creates a new instance of the Builder with the given context. The context passed in may be used to pop up some UI to ask the user to unlock or initialize the Android KeyStore facility.

Parameters
context Context: This value must never be null.

Public methods

setEncryptionRequired

added in API level 18
fun 
        setEncryptionRequired
(required: Boolean): KeyStoreParameter.Builder

Deprecated:

This class was deprecated in API level 21.

Sets whether this java.security.KeyStore entry must be encrypted at rest. Encryption at rest will protect the entry with the secure lock screen credential (e.g., password, PIN, or pattern).

Note that enabling this feature requires that the secure lock screen (e.g., password, PIN, pattern) is set up, otherwise setting the KeyStore entry will fail. Moreover, this entry will be deleted when the secure lock screen is disabled or reset (e.g., by the user or a Device Administrator). Finally, this entry cannot be used until the user unlocks the secure lock screen after boot.
Requires API level 18 (Android 4.3, Jelly Bean)

Return
KeyStoreParameter.Builder: This value will never be null.

build

added in API level 18
fun 
        build
(): KeyStoreParameter

Deprecated:

This class was deprecated in API level 21.

Builds the instance of the KeyStoreParameter.
Requires API level 18 (Android 4.3, Jelly Bean)

Return
KeyStoreParameter: built instance of KeyStoreParameter This value will never be null.
Exceptions
IllegalArgumentException if a required field is missing