Top Description Fields Constructors Methods
com.github.javakeyring.internal.freedesktop

public final Class SimpleCollection

extends Object
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Imports
java.io.IOException, java.security.AccessControlException, .InvalidAlgorithmParameterException, .InvalidKeyException, .NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException, java.util.Arrays, .List, .Map, javax.crypto.BadPaddingException, .IllegalBlockSizeException, .NoSuchPaddingException, org.freedesktop.dbus.DBusPath, .ObjectPath, org.freedesktop.dbus.connections.impl.DBusConnection, org.freedesktop.dbus.exceptions.DBusException, org.freedesktop.dbus.types.Variant, org.freedesktop.secret.Collection, .Item, .Pair, .Prompt, .Secret, .Service, .Session, .Static, .TransportEncryption, org.freedesktop.secret.interfaces.Prompt.Completed, org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface

A clone of org.freedesktop.secret.simple.SimpleCollection, with the prompting capability removed.

Field Summary

Modifier and TypeField and Description
private Collection
private Secret
private TransportEncryption
private Prompt
private Service
private Session
private InternalUnsupportedGuiltRiddenInterface

Constructor Summary

AccessConstructor and Description
public
SimpleCollection()

The default collection.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears the private key of the transport encryption and the passphrase of the collection.

public void
close()

Implements java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

public String

Returns:

DBus object path
createItem
(String
The displayable label of the new item
label
,
CharSequence
The password of the new item
password
,
Map<String, String>
The attributes of the new item
attributes
)

Creates an item with the provided properties in this collection.

public String

Returns:

DBus object path
createItem
(String
The displayable label of the new item
label
,
CharSequence
The password of the new item
password
)

Creates an item with the provided properties in this collection.

public void
deleteItem(String
The DBus object path of the item
objectPath
)

Delete an item from this collection.

private Item
public List<String>

Returns:

object paths
getItems
(Map<String, String>
The attributes of the secret
attributes
)

Get the object paths of items with given attributes.

public char[]

Returns:

plain chars
getSecret
(String
The DBus object path of the item
objectPath
)

Get the secret of the item.

private void
init()

private void
performPrompt(ObjectPath path)
References Deprecated ObjectPath is deprecated or references (maybe indirectly) at least one deprecated element.

private void
public void
updateItem(String
The DBus object path of the item
objectPath
,
String
The displayable label of the new item
label
,
CharSequence
The password of the new item
password
,
Map<String, String>
The attributes of the new item
attributes
)

Updates an item with the provided properties.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

collectionback to summary
private Collection collection
encryptedback to summary
private Secret encrypted
encryptionback to summary
private TransportEncryption encryption
promptback to summary
private Prompt prompt
serviceback to summary
private Service service
sessionback to summary
private Session session
withoutPromptback to summary
private InternalUnsupportedGuiltRiddenInterface withoutPrompt

Constructor Detail

SimpleCollectionback to summary
public SimpleCollection() throws IOException

The default collection.

Exceptions
IOException:
if dbus collection can not be accessed.

Method Detail

clearback to summary
public void clear()

Clears the private key of the transport encryption and the passphrase of the collection.

closeback to summary
public void close() throws Exception

Implements java.lang.AutoCloseable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
Exceptions
Exception:
if this resource cannot be closed
createItemback to summary
public String createItem(String label, CharSequence password, Map<String, String> attributes) throws IllegalArgumentException

Creates an item with the provided properties in this collection.

Parameters
label:String

The displayable label of the new item

password:CharSequence

The password of the new item

attributes:Map<String, String>

The attributes of the new item

Returns:String

DBus object path

Annotations
@SuppressWarnings:rawtypes
Exceptions
IllegalArgumentException:
if inputs are null
createItemback to summary
public String createItem(String label, CharSequence password) throws IllegalArgumentException

Creates an item with the provided properties in this collection.

Parameters
label:String

The displayable label of the new item

password:CharSequence

The password of the new item

Returns:String

DBus object path

Exceptions
IllegalArgumentException:
if inputs are null
deleteItemback to summary
public void deleteItem(String objectPath) throws AccessControlException

Delete an item from this collection.

Parameters
objectPath:String

The DBus object path of the item

Exceptions
AccessControlException:
if user is prompted and refuses.
getItemback to summary
private Item getItem(String path)
getItemsback to summary
public List<String> getItems(Map<String, String> attributes)

Get the object paths of items with given attributes.

Parameters
attributes:Map<String, String>

The attributes of the secret

Returns:List<String>

object paths

getSecretback to summary
public char[] getSecret(String objectPath)

Get the secret of the item.

Parameters
objectPath:String

The DBus object path of the item

Returns:char[]

plain chars

initback to summary
private void init() throws IOException
performPromptback to summary
private void performPrompt(ObjectPath path)

References Deprecated

ObjectPath is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

unlockback to summary
private void unlock()
updateItemback to summary
public void updateItem(String objectPath, String label, CharSequence password, Map<String, String> attributes) throws IllegalArgumentException

Updates an item with the provided properties.

Parameters
objectPath:String

The DBus object path of the item

label:String

The displayable label of the new item

password:CharSequence

The password of the new item

attributes:Map<String, String>

The attributes of the new item

Exceptions
IllegalArgumentException:
if inputs are null