public static final class AndroidKeysetManager.Builder extends Object
AndroidKeysetManager.
This class is thread-safe.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AndroidKeysetManager |
build()
Builds and returns a new
AndroidKeysetManager with the specified options. |
AndroidKeysetManager.Builder |
doNotUseKeystore()
Deprecated.
Android Keystore can be disabled by not setting a master key URI.
|
AndroidKeysetManager.Builder |
withKeyTemplate(KeyTemplate val)
Deprecated.
This method takes a KeyTemplate proto, which is an internal implementation
detail. Please use the withKeyTemplate method that takes a
KeyTemplate POJO. |
AndroidKeysetManager.Builder |
withKeyTemplate(KeyTemplate val)
If the keyset is not found or valid, generates a new one using
val. |
AndroidKeysetManager.Builder |
withMasterKeyUri(String val)
Sets the master key URI.
|
AndroidKeysetManager.Builder |
withSharedPref(Context context,
String keysetName,
String prefFileName)
Reads and writes the keyset from shared preferences.
|
@CanIgnoreReturnValue public AndroidKeysetManager.Builder withSharedPref(Context context, String keysetName, String prefFileName) throws IOException
IOException@CanIgnoreReturnValue public AndroidKeysetManager.Builder withMasterKeyUri(String val)
Only master keys stored in Android Keystore is supported. The URI must start with android-keystore://.
@CanIgnoreReturnValue @Deprecated public AndroidKeysetManager.Builder withKeyTemplate(KeyTemplate val)
KeyTemplate POJO.val.@CanIgnoreReturnValue public AndroidKeysetManager.Builder withKeyTemplate(KeyTemplate val)
val.@CanIgnoreReturnValue @Deprecated public AndroidKeysetManager.Builder doNotUseKeystore()
Warning: When Android Keystore is disabled, keys are stored in cleartext. This should be safe because they are stored in private preferences.
public AndroidKeysetManager build() throws GeneralSecurityException, IOException
AndroidKeysetManager with the specified options.IOException - If a keyset is found but unusable.KeystoreException - If a master key is found but unusable.GeneralSecurityException - If cannot read an existing keyset or generate a new one.