Class SimpleCollection
java.lang.Object
com.github.javakeyring.internal.freedesktop.SimpleCollection
- All Implemented Interfaces:
AutoCloseable
A clone of
SimpleCollection, with the prompting capability removed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the private key of the transport encryption and the passphrase of the collection.voidclose()createItem(String label, CharSequence password) Creates an item with the provided properties in this collection.createItem(String label, CharSequence password, Map<String, String> attributes) Creates an item with the provided properties in this collection.voiddeleteItem(String objectPath) Delete an item from this collection.Get the object paths of items with given attributes.char[]Get the secret of the item.voidupdateItem(String objectPath, String label, CharSequence password, Map<String, String> attributes) Updates an item with the provided properties.
-
Constructor Details
-
SimpleCollection
The default collection.- Throws:
IOException- if dbus collection can not be accessed.
-
-
Method Details
-
clear
public void clear()Clears the private key of the transport encryption and the passphrase of the collection. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
createItem
public String createItem(String label, CharSequence password, Map<String, String> attributes) throws IllegalArgumentExceptionCreates an item with the provided properties in this collection.- Parameters:
label- The displayable label of the new itempassword- The password of the new itemattributes- The attributes of the new item- Returns:
- DBus object path
- Throws:
IllegalArgumentException- if inputs are null
-
createItem
Creates an item with the provided properties in this collection.- Parameters:
label- The displayable label of the new itempassword- The password of the new item- Returns:
- DBus object path
- Throws:
IllegalArgumentException- if inputs are null
-
updateItem
public void updateItem(String objectPath, String label, CharSequence password, Map<String, String> attributes) throws IllegalArgumentExceptionUpdates an item with the provided properties.- Parameters:
objectPath- The DBus object path of the itemlabel- The displayable label of the new itempassword- The password of the new itemattributes- The attributes of the new item- Throws:
IllegalArgumentException- if inputs are null
-
getItems
Get the object paths of items with given attributes.- Parameters:
attributes- The attributes of the secret- Returns:
- object paths
-
getSecret
Get the secret of the item.- Parameters:
objectPath- The DBus object path of the item- Returns:
- plain chars
-
deleteItem
Delete an item from this collection.- Parameters:
objectPath- The DBus object path of the item- Throws:
AccessControlException- if user is prompted and refuses.
-