The following table shows the methods used in Java clients for managing credentials.

Java Description
addPassword(hostname, username, password) Stores the password for the specified host and user. Overwrites any existing password for that user in the credential store. Creates the default credential store backing file in the default location (if it does not exist).
removePassword(hostname, username) Deletes the password for the specified user from the credential store.
clearPasswords() Deletes all passwords from the credential store.
getPassword(hostname, username) Returns the password for the specified host and user from the credential store.
getHosts() Returns the set of hosts contained in the credential store.
getUsernames(hostname) Returns the collection of all user names that have passwords stored for the specified hostname.
close() Closes the credential store, preventing further method invocations. Releases associated resources.