public class CredentialsStorageServiceImpl extends java.lang.Object implements CredentialsStorageService
CredentialsStorageService
to load and store user
credentials from/to the ConfigurationService
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACCOUNT_ENCRYPTED_PASSWORD
The name of a property which represents an encrypted password.
|
static java.lang.String |
ACCOUNT_UNENCRYPTED_PASSWORD
The name of a property which represents an unencrypted password.
|
Constructor and Description |
---|
CredentialsStorageServiceImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
changeMasterPassword(java.lang.String oldPassword,
java.lang.String newPassword)
Changes the master password from the old to the new one.
|
boolean |
isStoredEncrypted(java.lang.String accountPrefix)
Check if encrypted account password is saved in the configuration.
|
boolean |
isUsingMasterPassword()
Checks if master password is used to encrypt saved account passwords.
|
java.lang.String |
loadPassword(java.lang.String accountPrefix)
Loads the password for the specified account.
|
boolean |
removePassword(java.lang.String accountPrefix)
Removes the password for the account that starts with the given prefix by
setting its value in the configuration to null.
|
(package private) void |
start(org.osgi.framework.BundleContext bc)
Initializes the credentials service by fetching the configuration service
reference from the bundle context.
|
(package private) void |
stop()
Forget the encryption/decryption key when stopping the service.
|
boolean |
storePassword(java.lang.String accountPrefix,
java.lang.String password)
Stores the password for the specified account.
|
boolean |
verifyMasterPassword(java.lang.String master)
Verifies the correctness of the master password.
|
public static final java.lang.String ACCOUNT_ENCRYPTED_PASSWORD
public static final java.lang.String ACCOUNT_UNENCRYPTED_PASSWORD
void start(org.osgi.framework.BundleContext bc)
bc
- bundle contextvoid stop()
public boolean storePassword(java.lang.String accountPrefix, java.lang.String password)
storePassword
in interface CredentialsStorageService
accountPrefix
- account prefixpassword
- the password to storestorePassword(String, String)
public java.lang.String loadPassword(java.lang.String accountPrefix)
loadPassword
in interface CredentialsStorageService
accountPrefix
- account prefixcreateCrypto()
public boolean removePassword(java.lang.String accountPrefix)
removePassword
in interface CredentialsStorageService
accountPrefix
- account prefixpublic boolean isUsingMasterPassword()
isUsingMasterPassword
in interface CredentialsStorageService
public boolean verifyMasterPassword(java.lang.String master)
MASTER_PROP_VALUE
is equal to the decrypted MASTER_PROP
's value, then
the MP is considered correct.verifyMasterPassword
in interface CredentialsStorageService
master
- master passwordpublic boolean changeMasterPassword(java.lang.String oldPassword, java.lang.String newPassword)
changeMasterPassword
in interface CredentialsStorageService
oldPassword
- old master passwordnewPassword
- new master passwordpublic boolean isStoredEncrypted(java.lang.String accountPrefix)
isStoredEncrypted
in interface CredentialsStorageService
accountPrefix
- account prefix
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.