Skip to content

Most visited

Recently visited

navigation
Added in API level 18
Deprecated since API level 23

KeyStoreParameter.Builder

public static final class KeyStoreParameter.Builder
extends Object

java.lang.Object
   ↳ android.security.KeyStoreParameter.Builder


This class was deprecated in API level 23.
Use KeyProtection.Builder instead.

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();
 

Summary

Public constructors

KeyStoreParameter.Builder(Context context)

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

Public methods

KeyStoreParameter build()

Builds the instance of the KeyStoreParameter.

KeyStoreParameter.Builder setEncryptionRequired(boolean required)

Sets whether this KeyStore entry must be encrypted at rest.

Inherited methods

From class java.lang.Object

Public constructors

KeyStoreParameter.Builder

Added in API level 18
KeyStoreParameter.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

Public methods

build

Added in API level 18
KeyStoreParameter build ()

Builds the instance of the KeyStoreParameter.

Returns
KeyStoreParameter built instance of KeyStoreParameter
Throws
IllegalArgumentException if a required field is missing

setEncryptionRequired

Added in API level 18
KeyStoreParameter.Builder setEncryptionRequired (boolean required)

Sets whether this 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.

Parameters
required boolean
Returns
KeyStoreParameter.Builder

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.