Class FreedesktopKeyringBackend
- java.lang.Object
-
- com.github.javakeyring.internal.freedesktop.FreedesktopKeyringBackend
-
- All Implemented Interfaces:
KeyringBackend,AutoCloseable
public class FreedesktopKeyringBackend extends Object implements KeyringBackend
Keyring backend which uses Freedesktop Secret service. Seems that concurrent reads/writes are unsafe. Not sure if a problem with the java libraries or the secret-service in dbus.
Maybe replace with https://specifications.freedesktop.org/secret-service/?
-
-
Constructor Summary
Constructors Constructor Description FreedesktopKeyringBackend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the collection.voiddeletePassword(String service, String account)Delete password to key store.StringgetPassword(String service, String account)Gets password from key store.voidsetPassword(String service, String account, String password)Sets password to key store.
-
-
-
Constructor Detail
-
FreedesktopKeyringBackend
public FreedesktopKeyringBackend() throws BackendNotSupportedException- Throws:
BackendNotSupportedException
-
-
Method Detail
-
getPassword
public String getPassword(String service, String account) throws PasswordAccessException
Gets password from key store.- Specified by:
getPasswordin interfaceKeyringBackend- Parameters:
service- Service nameaccount- Account name- Returns:
- Password related to specified service and account
- Throws:
PasswordAccessException- Thrown when an error happened while getting password
-
setPassword
public void setPassword(String service, String account, String password) throws PasswordAccessException
Sets password to key store.- Specified by:
setPasswordin interfaceKeyringBackend- Parameters:
service- Service nameaccount- Account namepassword- Password- Throws:
PasswordAccessException- Thrown when an error happened while saving the password
-
deletePassword
public void deletePassword(String service, String account) throws PasswordAccessException
Delete password to key store.- Specified by:
deletePasswordin interfaceKeyringBackend- Parameters:
service- Service nameaccount- Account name- Throws:
PasswordAccessException- Thrown when an error happened while deleting the password
-
close
public void close() throws ExceptionCloses the collection.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-