public abstract class PasswordProvider extends Object
Password provider modules can be thought of as trusted 3rd parties used to provide passwords to open keyrings containing secure preferences. They can do it, for instance, by asking the user to enter password, or integrating with operating system login, or exchanging information with a device such as a smart card reader.
Use org.eclipse.equinox.security.secureStorage extension point to contribute password provider module to the secure storage system.
Modifier and Type | Field and Description |
---|---|
static int |
CREATE_NEW_PASSWORD
Bit mask for the password type field of the
getPassword(IPreferencesContainer, int)
method. |
static int |
PASSWORD_CHANGE
Bit mask for the password type field of the
getPassword(IPreferencesContainer, int)
method. |
Constructor and Description |
---|
PasswordProvider()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract PBEKeySpec |
getPassword(IPreferencesContainer container,
int passwordType)
This method should return the password used to encrypt entries in the secure
preferences.
|
boolean |
retryOnError(Exception e,
IPreferencesContainer container)
The framework might call this method if it suspects that the password is invalid
(for instance, due to a failed data decryption).
|
public static final int CREATE_NEW_PASSWORD
getPassword(IPreferencesContainer, int)
method. If value at this bit set to 1
, it indicates that a new
password should be created; otherwise this is a request for the password previously
used for this secure storage.public static final int PASSWORD_CHANGE
getPassword(IPreferencesContainer, int)
method. If value at this bit set to 1
, it indicates that a new password
is requested as a part of the password change operation.public abstract PBEKeySpec getPassword(IPreferencesContainer container, int passwordType)
container
- container of the secure preferencespasswordType
- the collection of bits that describes password type requested. See
CREATE_NEW_PASSWORD
and PASSWORD_CHANGE
. When evaluating value of this
field use bit-wise filters as additional bits might be used in future versionsnull
if unable to obtain passwordpublic boolean retryOnError(Exception e, IPreferencesContainer container)
e
- exception that occurred in the secure preferences processingcontainer
- container of the secure preferencestrue
if a different password might be provided; false
otherwise. If in doubt, return false
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.