KeyProtection.Builder
instead.@Deprecated public static final class KeyStoreParameter.Builder extends Object
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();
Constructor and Description |
---|
Builder(Context context)
Deprecated.
Creates a new instance of the
Builder with the given
context . |
Modifier and Type | Method and Description |
---|---|
KeyStoreParameter |
build()
Deprecated.
Builds the instance of the
KeyStoreParameter . |
KeyStoreParameter.Builder |
setEncryptionRequired(boolean required)
Deprecated.
Sets whether this
KeyStore entry must be encrypted at rest. |
public Builder(Context context)
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 KeyStoreParameter.Builder setEncryptionRequired(boolean required)
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.
KeyguardManager.isDeviceSecure()
public KeyStoreParameter build()
KeyStoreParameter
.KeyStoreParameter
IllegalArgumentException
- if a required field is missing