public interface Keyring
| Modifier and Type | Method and Description |
|---|---|
static Keyring |
create()
Creates a keyring for the current OS.
|
java.lang.String |
getBackendName()
Gets the name of the backend.
|
java.lang.String |
getPassword(java.lang.String service,
java.lang.String account)
Gets a password for the specified service and account.
|
void |
setPassword(java.lang.String service,
java.lang.String account,
java.lang.String password)
Sets a password for the specified service and account.
|
static void |
validateAccount(java.lang.String account)
Validates the account.
|
static void |
validatePassword(java.lang.String password)
Validates the password.
|
static void |
validateService(java.lang.String service)
Validates the service.
|
static Keyring create() throws UnsupportedBackendException
UnsupportedBackendException - if there is no backend available.java.lang.String getBackendName()
java.lang.String getPassword(java.lang.String service,
java.lang.String account)
throws PasswordAccessException
service - The service.account - The account.PasswordAccessException - if any exception occurs while getting the password.void setPassword(java.lang.String service,
java.lang.String account,
java.lang.String password)
throws PasswordAccessException
service - The service.account - The account.password - The password or null to remove.PasswordAccessException - if any exception occurs while saving the password.static void validateService(java.lang.String service)
service - The service.static void validateAccount(java.lang.String account)
account - The account.static void validatePassword(java.lang.String password)
password - The password.