Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public static final class

KeyStoreParameter.Builder

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

Class Overview

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 KeyPairGeneratorSpec .
KeyStoreParameter.Builder setEncryptionRequired (boolean required)
Indicates that this key must be encrypted at rest on storage.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public 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.

Public Methods

public KeyStoreParameter build ()

Builds the instance of the KeyPairGeneratorSpec .

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

public KeyStoreParameter.Builder setEncryptionRequired (boolean required)

Indicates that this key must be encrypted at rest on storage. Note that enabling this will require that the user enable a strong lock screen (e.g., PIN, password) before creating or using the generated key is successful.