public interface CredentialStore
For each method with a host parameter, the host may be specified as a
DNS domain name, an IPv4 address, or an IPv6 address. When looking up a
username or password, the host must be specified in the same manner (DNS,
IPv4, or IPv6) as when it was stored.
The methods in this interface may be invoked concurrently by multiple threads.
CredentialStoreFactory| Modifier and Type | Method and Description |
|---|---|
boolean |
addPassword(java.lang.String host,
java.lang.String username,
java.lang.String password)
Stores the password for a given host and username.
|
void |
clearPasswords()
Removes all passwords.
|
void |
close()
Closes this credential store and frees all resources associated with it.
|
java.util.Set<java.lang.String> |
getHosts()
Returns all hosts that have entries in the credential store.
|
java.lang.String |
getPassword(java.lang.String host,
java.lang.String username)
Gets the password for a given host and username.
|
java.util.Set<java.lang.String> |
getUsernames(java.lang.String host)
Returns all usernames that have passwords stored for a given host.
|
boolean |
removePassword(java.lang.String host,
java.lang.String username)
Removes the password for a given host and username.
|
java.lang.String getPassword(java.lang.String host,
java.lang.String username)
throws java.io.IOException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
null if none is foundjava.io.IOExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionboolean addPassword(java.lang.String host,
java.lang.String username,
java.lang.String password)
throws java.io.IOException
true if a password for this host and username did not
already existjava.io.IOExceptionboolean removePassword(java.lang.String host,
java.lang.String username)
throws java.io.IOException
true if the password existed and was removedjava.io.IOExceptionvoid clearPasswords()
throws java.io.IOException
java.io.IOExceptionjava.util.Set<java.lang.String> getHosts()
throws java.io.IOException
java.io.IOExceptionjava.util.Set<java.lang.String> getUsernames(java.lang.String host)
throws java.io.IOException
java.io.IOExceptionvoid close()
throws java.io.IOException
CredentialStore methods may be invoked on this object.java.io.IOException