public class WalletStoreProvider extends Object implements CredentialStore
| Constructor and Description |
|---|
WalletStoreProvider(ConfigStoreType type, String url, String location, char[] passPhrase)
Create a config store based wallet retrieving credentials from the server
|
WalletStoreProvider(File dir)
Creates a WalletStoreProvider.
|
WalletStoreProvider(File dir, char[] walletPassword)
Creates an encrypted WalletStoreProvider.
|
WalletStoreProvider(String dirName)
Creates a WalletStoreProvider.
|
WalletStoreProvider(String dirName, char[] walletPassword)
Creates a WalletStoreProvider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeWallet(boolean forcedSave)
Closes the contained wallet.
|
void |
createWallet()
Creates a new wallet based in the wallet being managed.
|
void |
deleteCredentailsStore()
Delete the underlying wallet.
|
void |
deleteCredential(String alias)
Deletes the requested credential.
|
void |
deleteCredentials(List<String> aliasList)
Delete a list of credentials from the underlying wallet.
|
boolean |
exists(String alias)
Determines of an alias exists in the managed wallet.
|
Credential |
getCredential(String alias)
Returns the credential from the wallet store with the provided alias.
|
static String |
getDefaultWalletLocation()
Returns the default wallet location.
|
Wallet |
getWallet()
Returns the wallet contained within this provider.
|
static boolean |
isAutoLogin(String walletDirectory)
Determines if a wallet is an auto-login wallet.
|
Credentials |
loadCredentials()
Retrieve a list of credentials from underlying wallet.
|
void |
setCredential(Credential cred)
Sets a credential to the managed wallet.
|
void |
setWallet(Wallet wallet)
Set the wallet managed by this provider.
|
void |
storeCredentials(Credentials credentials)
Storing a list of credentials to the underlying wallet.
|
boolean |
walletExists(String location, char[] walletPassword)
Determines if a wallet exists.
|
public WalletStoreProvider(File dir) throws FMWCredentialsException
dir - location of the walletFMWCredentialsException - if an error occurspublic WalletStoreProvider(File dir, char[] walletPassword) throws FMWCredentialsException
dir - location of the walletwalletPassword - password fro an encrypted walletFMWCredentialsException - if an error occurspublic WalletStoreProvider(String dirName)
dirName - location of the walletpublic WalletStoreProvider(String dirName, char[] walletPassword) throws FMWCredentialsException
dirName - location of the walletwalletPassword - password for an encrypted walletFMWCredentialsException - if an error occurspublic WalletStoreProvider(ConfigStoreType type, String url, String location, char[] passPhrase) throws FMWCredentialsException
type - the type of config store being usedurl - base URL of the config store serverlocation - the config store key for retrieving/storing credential datapassPhrase - the phrase used to encrypt the credential dataFMWCredentialsException - if an error occurspublic static String getDefaultWalletLocation()
public static boolean isAutoLogin(String walletDirectory) throws FMWCredentialsException
walletDirectory - location of the walletFMWCredentialsException - if an error occurspublic Wallet getWallet()
public void setWallet(Wallet wallet)
wallet - the wallet to be managed
public void closeWallet(boolean forcedSave)
throws FMWCredentialsException
forcedSave - if true save the wallet before closingFMWCredentialsException - if an error occurs
public void createWallet()
throws FMWCredentialsException
FMWCredentialsException - if an error occurs
public void deleteCredentailsStore()
throws FMWCredentialsException
deleteCredentailsStore in interface CredentialStoreFMWCredentialsException - an error occurred when deleting the wallet.public void deleteCredential(String alias) throws FMWCredentialsException
alias - the credential alias to be deletedFMWCredentialsException - if an error occurspublic void deleteCredentials(List<String> aliasList) throws FMWCredentialsException
deleteCredentials in interface CredentialStorealiasList - a list of credential aliases that are being deleted.FMWCredentialsException - an error occurred when deleting credentials from the wallet.public boolean exists(String alias)
alias - the alias to be locatedpublic Credentials loadCredentials() throws FMWCredentialsException
loadCredentials in interface CredentialStoreFMWCredentialsException - an error occurred when retrieving credentials from the wallet.public Credential getCredential(String alias) throws FMWCredentialsException
CredentialStoregetCredential in interface CredentialStorealias - of the credential in the wallet store. If alias is null, will return a null credentialFMWCredentialsException - if there was a problem accessing the wallet storepublic void setCredential(Credential cred) throws FMWCredentialsException
cred - the credential to be setFMWCredentialsException - if an error occurspublic void storeCredentials(Credentials credentials) throws FMWCredentialsException
storeCredentials in interface CredentialStorecredentials - a list of credentials that are being persistedFMWCredentialsException - an error occurred when storing credentials to the wallet.public boolean walletExists(String location, char[] walletPassword)
location - the wallet locationwalletPassword - the wallet password