Class Service
- java.lang.Object
-
- org.freedesktop.secret.handlers.Messaging
-
- org.freedesktop.secret.interfaces.Service
-
- org.freedesktop.secret.Service
-
- All Implemented Interfaces:
org.freedesktop.dbus.interfaces.DBusInterface
public class Service extends Service
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.freedesktop.secret.interfaces.Service
Service.CollectionChanged, Service.CollectionCreated, Service.CollectionDeleted
-
-
Field Summary
Fields Modifier and Type Field Description static List<Class<? extends org.freedesktop.dbus.messages.DBusSignal>>signals-
Fields inherited from class org.freedesktop.secret.handlers.Messaging
connection, interfaceName, msg, objectPath, serviceName, sh
-
-
Constructor Summary
Constructors Constructor Description Service(org.freedesktop.dbus.connections.impl.DBusConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.freedesktop.dbus.ObjectPathchangeLock(org.freedesktop.dbus.ObjectPath collection)Toggle the lock for a collection with a prompt.Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath>createCollection(Map<String,org.freedesktop.dbus.types.Variant> properties)Create a new collection with the specified properties.Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath>createCollection(Map<String,org.freedesktop.dbus.types.Variant> properties, String alias)Create a new collection with the specified properties.List<org.freedesktop.dbus.ObjectPath>getCollections()StringgetObjectPath()Map<org.freedesktop.dbus.ObjectPath,Secret>getSecrets(List<org.freedesktop.dbus.ObjectPath> items, org.freedesktop.dbus.ObjectPath session)Retrieve multiple secrets from different items.SessiongetSession()booleanisRemote()Pair<List<org.freedesktop.dbus.ObjectPath>,org.freedesktop.dbus.ObjectPath>lock(List<org.freedesktop.dbus.ObjectPath> objects)Lock the items.voidlockService()Lock the entire Secret Service API.Pair<org.freedesktop.dbus.types.Variant<byte[]>,org.freedesktop.dbus.ObjectPath>openSession(String algorithm, org.freedesktop.dbus.types.Variant input)Open a unique session for the caller application.org.freedesktop.dbus.ObjectPathreadAlias(String name)Get the collection with the given alias.Pair<List<org.freedesktop.dbus.ObjectPath>,List<org.freedesktop.dbus.ObjectPath>>searchItems(Map<String,String> attributes)Find items in any collection.voidsetAlias(String name, org.freedesktop.dbus.ObjectPath collection)Setup a collection alias.Pair<List<org.freedesktop.dbus.ObjectPath>,org.freedesktop.dbus.ObjectPath>unlock(List<org.freedesktop.dbus.ObjectPath> objects)Unlock the specified objects.-
Methods inherited from class org.freedesktop.secret.handlers.Messaging
getAllProperties, getConnection, getInterfaceName, getMessageHandler, getPath, getProperty, getServiceName, getSignalHandler, send, send, setProperty
-
-
-
-
Method Detail
-
openSession
public Pair<org.freedesktop.dbus.types.Variant<byte[]>,org.freedesktop.dbus.ObjectPath> openSession(String algorithm, org.freedesktop.dbus.types.Variant input)
Description copied from class:ServiceOpen a unique session for the caller application.- Specified by:
openSessionin classService- Parameters:
algorithm- The algorithm the caller wishes to use.input- Input arguments for the algorithm.- Returns:
- Pair<output, result>
output — Output of the session algorithm negotiation.
result — The object path of the session, if session was created. - See Also:
Pair,Variant,ObjectPath
-
createCollection
public Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath> createCollection(Map<String,org.freedesktop.dbus.types.Variant> properties, String alias)
Description copied from class:ServiceCreate a new collection with the specified properties.- Specified by:
createCollectionin classService- Parameters:
properties- Properties for the new collection. This allows setting the new collection's properties upon its creation. All READWRITE properties are usable. Specify the property names in full interface.Property form.
Example for properties:properties = { "org.freedesktop.Secret.Collection.Label": "MyCollection" }alias- If creating this connection for a well known alias then a string like"default". If an collection with this well-known alias already exists, then that collection will be returned instead of creating a new collection. Any readwrite properties provided to this function will be set on the collection.
Set this to an empty string if the new collection should not be associated with a well known alias.- Returns:
- Pair<collection, prompt>
collection — The new collection object, or '/' if prompting is necessary.
prompt — A prompt object if prompting is necessary, or '/' if no prompt was needed. - See Also:
Pair,Variant,ObjectPath
-
createCollection
public Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath> createCollection(Map<String,org.freedesktop.dbus.types.Variant> properties)
Description copied from class:ServiceCreate a new collection with the specified properties.- Specified by:
createCollectionin classService- Parameters:
properties- Properties for the new collection. This allows setting the new collection's properties upon its creation. All READWRITE properties are usable. Specify the property names in full interface.Property form.
Example for properties:properties = { "org.freedesktop.Secret.Collection.Label": "MyCollection" }- Returns:
- Pair<collection, prompt>
collection — The new collection object, or '/' if prompting is necessary.
prompt — A prompt object if prompting is necessary, or '/' if no prompt was needed. - See Also:
Pair,Variant,ObjectPath
-
searchItems
public Pair<List<org.freedesktop.dbus.ObjectPath>,List<org.freedesktop.dbus.ObjectPath>> searchItems(Map<String,String> attributes)
Description copied from class:ServiceFind items in any collection.- Specified by:
searchItemsin classService- Parameters:
attributes- Find secrets in any collection.Example:
{ "Attribute1": "Value1", "Attribute2": "Value2" }Note: Please note that there is a distinction between the terms Property, which refers to D-Bus properties of an object, and Attribute, which refers to one of a secret item's string-valued attributes.
- Returns:
- Pair<unlocked, locked>
unlocked — Items found.
locked — Items found that require authentication. - See Also:
Pair,ObjectPath
-
unlock
public Pair<List<org.freedesktop.dbus.ObjectPath>,org.freedesktop.dbus.ObjectPath> unlock(List<org.freedesktop.dbus.ObjectPath> objects)
Description copied from class:ServiceUnlock the specified objects.- Specified by:
unlockin classService- Parameters:
objects- Objects to unlock.- Returns:
- Pair<unlocked, prompt>
unlocked — Objects that were unlocked without a prompt.
prompt — A prompt object which can be used to unlock the remaining objects, or the special value '/' when no prompt is necessary. - See Also:
Pair,ObjectPath
-
lock
public Pair<List<org.freedesktop.dbus.ObjectPath>,org.freedesktop.dbus.ObjectPath> lock(List<org.freedesktop.dbus.ObjectPath> objects)
Description copied from class:ServiceLock the items.
-
lockService
public void lockService()
Description copied from class:ServiceLock the entire Secret Service API.
See Also:
Service.lock(List objects)
Service.unlock(List objects)
InternalUnsupportedGuiltRiddenInterface.unlockWithMasterPassword(DBusPath collection, Secret master)- Specified by:
lockServicein classService
-
changeLock
public org.freedesktop.dbus.ObjectPath changeLock(org.freedesktop.dbus.ObjectPath collection)
Description copied from class:ServiceToggle the lock for a collection with a prompt.- Specified by:
changeLockin classService- Parameters:
collection- Path of the collection.- Returns:
- Path of the collection
See Also:
InternalUnsupportedGuiltRiddenInterface.changeWithPrompt(DBusPath collection)
-
getSecrets
public Map<org.freedesktop.dbus.ObjectPath,Secret> getSecrets(List<org.freedesktop.dbus.ObjectPath> items, org.freedesktop.dbus.ObjectPath session)
Description copied from class:ServiceRetrieve multiple secrets from different items.- Specified by:
getSecretsin classService- Parameters:
items- Items to get secrets for.session- The session to use to encode the secrets.- Returns:
- secrets — Secrets for the items.
- See Also:
Secret,ObjectPath
-
readAlias
public org.freedesktop.dbus.ObjectPath readAlias(String name)
Description copied from class:ServiceGet the collection with the given alias.- Specified by:
readAliasin classService- Parameters:
name- An alias, such as 'default'.- Returns:
- collection — The collection or the the path '/' if no such collection exists.
- See Also:
Static.ObjectPaths,ObjectPath,Collection
-
setAlias
public void setAlias(String name, org.freedesktop.dbus.ObjectPath collection)
Description copied from class:ServiceSetup a collection alias.- Specified by:
setAliasin classService- Parameters:
name- An alias, such as 'default'.collection- The collection to make the alias point to. To remove an alias use the special value '/'.- See Also:
ObjectPath,Collection
-
getCollections
public List<org.freedesktop.dbus.ObjectPath> getCollections()
- Specified by:
getCollectionsin classService- Returns:
- A list of present collections.
-
isRemote
public boolean isRemote()
-
getObjectPath
public String getObjectPath()
- Specified by:
getObjectPathin interfaceorg.freedesktop.dbus.interfaces.DBusInterface- Overrides:
getObjectPathin classMessaging
-
getSession
public Session getSession()
-
-