public interface MasterPasswordProvider
A typical implementation of this class would pop up a dialog to ask the user
for the master password. Such providers should check
GraphicsEnvironment#isHeadless() before returning, to avoid attempts
to pop up dialogues on server/headless installations.
Another example may be to read the master password from a file or from command line parameters.
|Modifier and Type||Interface and Description|
Set the provider's priority that determines the order in which various master password providers will be invoked.
|Modifier and Type||Method and Description|
Get the master password for the Credential Manager.
Get the priority of this provider.
Set the master password.
String getMasterPassword(boolean firstTime)
This method will only be called if the provider returned
If the parameter
true, this is a
request for setting the master password, as the Keystore and
Truststore have not been created yet.
trueif this is the first time the keystore is accessed, in which case the returned password will be used to encrypt the keystore. If
false, the returned password will be used to decrypt (unlock) the keystore.
nullif not available (user cancelled, etc.)
void setMasterPassword(String password)
password- to set
The providers with highest priority will be asked first, lower-priority
providers will be asked only if the higher ones either return
false on the canProvideMasterPassword() method, or return
null on the corresponding actual request.
It is undetermined who will be asked first if providers have the same priority.
A typical priority for UI providers that pop up a dialog to as the user
100, allowing server-side providers to override
with priorities like
500, or fall-back providers (say by
reading system properties) to have a priority of
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.