public class Keyring extends Object
| Modifier and Type | Method and Description |
|---|---|
static Keyring |
create()
Creates an instance of Keyring using the a default backed based on operating system.
|
static Keyring |
create(Keyrings keyring)
Creates an instance of Keyring with specified backend.
|
void |
deletePassword(String service,
String account)
Sets password to key store (Proxy method of KeyringBackend.setPassword)
|
String |
getKeyStorePath()
Gets path to key store (Proxy method of KeyringBackend.getKeyStorePath).
|
String |
getPassword(String service,
String account)
Gets password from key store (Proxy method of KeyringBackend.getPassword).
|
boolean |
isKeyStorePathRequired()
Returns true if the backend directory uses some file to store passwords.
|
void |
setKeyStorePath(String path)
Sets path to key store (Proxy method of KeyringBackend.setKeyStorePath).
|
void |
setPassword(String service,
String account,
String password)
Sets password to key store (Proxy method of KeyringBackend.setPassword)
|
public static Keyring create() throws BackendNotSupportedException
BackendNotSupportedException - if the default backend for the operating system is unsupported.public static Keyring create(Keyrings keyring) throws BackendNotSupportedException
keyring - desired backend.BackendNotSupportedException - if the default backend for the operating system is unsupported.public String getKeyStorePath()
public void setKeyStorePath(String path)
path - Path to key storepublic boolean isKeyStorePathRequired()
public String getPassword(String service, String account) throws LockException, PasswordRetrievalException
service - Service nameaccount - Account namePasswordRetrievalException - Thrown when an error happened while getting passwordLockException - can't establish lock.public void setPassword(String service, String account, String password) throws LockException, PasswordSaveException
service - Service nameaccount - Account namepassword - PasswordPasswordSaveException - Thrown when an error happened while saving the passwordLockException - can't establish lock.public void deletePassword(String service, String account) throws LockException, PasswordSaveException
service - Service nameaccount - Account namePasswordSaveException - Thrown when an error happened while saving the passwordLockException - can't establish lock.Copyright © 2019 Java Keyring. All rights reserved.