Service
Object Hierarchy:
Secret.Service
Secret.Service
Secret.Service
GLib.DBusProxy
GLib.DBusProxy
GLib.DBusProxy->Secret.Service
GLib.Object
GLib.Object
GLib.Object->GLib.DBusProxy
GLib.AsyncInitable
GLib.AsyncInitable
GLib.AsyncInitable->Secret.Service
GLib.AsyncInitable->GLib.DBusProxy
GLib.DBusInterface
GLib.DBusInterface
GLib.DBusInterface->Secret.Service
GLib.DBusInterface->GLib.DBusProxy
GLib.Initable
GLib.Initable
GLib.Initable->Secret.Service
GLib.Initable->GLib.DBusProxy
Secret.Backend
Secret.Backend
Secret.Backend->Secret.Service
Description:
[
CCode ( type_id =
"secret_service_get_type ()" ) ]
public class Service :
DBusProxy ,
AsyncInitable ,
DBusInterface ,
Initable ,
Backend
A proxy object representing the Secret Service.
A Service object represents the Secret Service implementation which runs as a D-Bus service.
Normally a single Service object can be shared between multiple callers. The [funcService.get
]
method is used to access this Service object. If a new independent Service object is
required, use [funcService.open
].
In order to securely transfer secrets to the Sercret Service, a session is established. This session can be established while
initializing a Service object by passing the
OPEN_SESSION flag to the [funcService.get
] or [funcService.open
] functions. In order to establish a
session on an already existing Service , use the [methodService.ensure_session
] function.
To search for items, use the [methodService.search
] method.
Multiple collections can exist in the Secret Service, each of which contains secret items. In order to instantiate [classCollection
] objects which represent those collections while initializing a Service then pass the
LOAD_COLLECTIONS flag to the [funcService.get
] or
[funcService.open
] functions. In order to establish a session on an already existing Service , use
the [methodService.load_collections
] function. To access the list of collections use [methodService.get_collections
].
Certain actions on the Secret Service require user prompting to complete, such as creating a collection, or unlocking a collection. When
such a prompt is necessary, then a [classPrompt
] object is created by this library, and passed to the [method
Service.prompt
] method. In this way it is handled automatically.
In order to customize prompt handling, override the [vfuncService.prompt_async
] and [vfuncService.prompt_finish
] virtual methods of the Service class.
Content:
Static methods:
public static async Service @get (ServiceFlags flags, Cancellable ? cancellable) throws Error
Get a Service proxy for the Secret Service.
public static void disconnect ()
Disconnect the default Service proxy
returned by [funcService.get
] and [funcService.get_sync
].
public static Service get_sync (ServiceFlags flags, Cancellable ? cancellable = null ) throws Error
Get a Service proxy for the Secret Service.
public static async Service open (Type service_gtype, string ? service_bus_name, ServiceFlags flags, Cancellable ? cancellable) throws Error
Create a new Service proxy for the Secret
Service.
public static Service open_sync (Type service_gtype, string ? service_bus_name, ServiceFlags flags, Cancellable ? cancellable = null ) throws Error
Create a new Service proxy for the Secret
Service.
Creation methods:
Methods:
public async int @lock (List <DBusProxy > objects, Cancellable ? cancellable, out List <DBusProxy >? locked) throws Error
Lock items or collections in the secret service.
public async int @unlock (List <DBusProxy > objects, Cancellable ? cancellable, out List <DBusProxy >? unlocked) throws Error
Unlock items or collections in the secret service.
public bool clear_sync (Schema ? schema, HashTable <string ,string > attributes, Cancellable ? cancellable = null ) throws Error
Remove unlocked items which match the attributes from the secret
service.
public async string create_collection_dbus_path (HashTable <string ,Variant > properties, string ? alias, CollectionCreateFlags flags, Cancellable ? cancellable) throws Error
Create a new collection in the secret service, and return its path.
public string create_collection_dbus_path_sync (HashTable <string ,Variant > properties, string ? alias, CollectionCreateFlags flags, Cancellable ? cancellable = null ) throws Error
Create a new collection in the secret service and return its path.
public async string create_item_dbus_path (string collection_path, HashTable <string ,Variant > properties, Value value, ItemCreateFlags flags, Cancellable ? cancellable) throws Error
Create a new item in a secret service collection and return its D-Bus
object path.
public string create_item_dbus_path_sync (string collection_path, HashTable <string ,Variant > properties, Value value, ItemCreateFlags flags, Cancellable ? cancellable = null ) throws Error
Create a new item in a secret service collection and return its D-Bus
object path.
public Value decode_dbus_secret (Variant value)
Decode a [structValue
] into [structGLib.Variant
] received with the Secret Service DBus API.
public async bool delete_item_dbus_path (string item_path, Cancellable ? cancellable) throws Error
Delete a secret item from the secret service.
public bool delete_item_dbus_path_sync (string item_path, Cancellable ? cancellable = null ) throws Error
Delete a secret item from the secret service.
public unowned Variant encode_dbus_secret (Value value)
Encodes a [structValue
] into [structGLib.Variant
] for use with the Secret Service DBus API.
public async bool ensure_session (Cancellable ? cancellable) throws Error
Ensure that the Service proxy has
established a session with the Secret Service.
public bool ensure_session_sync (Cancellable ? cancellable = null ) throws Error
Ensure that the Service proxy has
established a session with the Secret Service.
public virtual Type get_collection_gtype ()
Get the GObject type for collections instantiated by this service.
public List <Collection >? get_collections ()
Get a list of [classCollection
] objects representing all
the collections in the secret service.
public ServiceFlags get_flags ()
Get the flags representing what features of the
Service proxy have been initialized.
public virtual Type get_item_gtype ()
Get the GObject type for items instantiated by this service.
public async Value ? get_secret_for_dbus_path (string item_path, Cancellable ? cancellable) throws Error
Get the secret value for a secret item stored in the service.
public Value ? get_secret_for_dbus_path_sync (string item_path, Cancellable ? cancellable = null ) throws Error
Get the secret value for a secret item stored in the service.
public async HashTable <string ,Value > get_secrets_for_dbus_paths (string item_paths, Cancellable ? cancellable) throws Error
Get the secret values for a secret item stored in the service.
public HashTable <string ,Value > get_secrets_for_dbus_paths_sync (string item_paths, Cancellable ? cancellable = null ) throws Error
Get the secret values for a secret item stored in the service.
public unowned string ? get_session_algorithms ()
Get the set of algorithms being used to transfer secrets between this
secret service proxy and the Secret Service itself.
public unowned string ? get_session_dbus_path ()
Get the D-Bus object path of the session object being used to transfer
secrets between this secret service proxy and the Secret Service itself.
public async bool load_collections (Cancellable ? cancellable) throws Error
Ensure that the Service proxy has loaded
all the collections present in the Secret Service.
public bool load_collections_sync (Cancellable ? cancellable = null ) throws Error
Ensure that the Service proxy has loaded
all the collections present in the Secret Service.
public async int lock_dbus_paths (string [] paths, Cancellable ? cancellable, out string []? locked) throws Error
Lock items or collections in the secret service.
public int lock_dbus_paths_sync (string [] paths, Cancellable ? cancellable, out string []? locked) throws Error
Lock items or collections in the secret service.
public int lock_sync (List <DBusProxy > objects, Cancellable ? cancellable, out List <DBusProxy >? locked) throws Error
Lock items or collections in the secret service.
public Value lookup_sync (Schema ? schema, HashTable <string ,string > attributes, Cancellable ? cancellable = null ) throws Error
Lookup a secret value in the secret service.
public async Variant prompt (Prompt prompt, VariantType ? return_type, Cancellable ? cancellable) throws Error
Perform prompting for a [classPrompt
].
public virtual async Variant prompt_async (Prompt prompt, VariantType return_type, Cancellable ? cancellable) throws Error
public async Variant ? prompt_at_dbus_path (string prompt_path, VariantType ? return_type, Cancellable ? cancellable) throws Error
Perform prompting for a [classPrompt
].
public Variant ? prompt_at_dbus_path_sync (string prompt_path, Cancellable ? cancellable, VariantType ? return_type) throws Error
Perform prompting for a [classPrompt
].
public virtual Variant prompt_sync (Prompt prompt, Cancellable ? cancellable, VariantType return_type) throws Error
Perform prompting for a [classPrompt
].
public async string ? read_alias_dbus_path (string alias, Cancellable ? cancellable) throws Error
Lookup which collection is assigned to this alias.
public string ? read_alias_dbus_path_sync (string alias, Cancellable ? cancellable = null ) throws Error
Lookup which collection is assigned to this alias.
public async bool search_for_dbus_paths (Schema ? schema, HashTable <string ,string > attributes, Cancellable ? cancellable, out string []? unlocked, out string []? locked) throws Error
Search for items matching the attributes
, and return
their D-Bus object paths.
public bool search_for_dbus_paths_sync (Schema ? schema, HashTable <string ,string > attributes, Cancellable ? cancellable, out string []? unlocked, out string []? locked) throws Error
Search for items matching the attributes
, and return
their D-Bus object paths.
public List <Item > search_sync (Schema ? schema, HashTable <string ,string > attributes, SearchFlags flags, Cancellable ? cancellable = null ) throws Error
Search for items matching the attributes
.
public async bool set_alias (string alias, Collection ? collection, Cancellable ? cancellable) throws Error
Assign a collection to this alias.
public bool set_alias_sync (string alias, Collection ? collection, Cancellable ? cancellable = null ) throws Error
Assign a collection to this alias.
public async bool set_alias_to_dbus_path (string alias, string ? collection_path, Cancellable ? cancellable) throws Error
Assign a collection to this alias.
public bool set_alias_to_dbus_path_sync (string alias, string ? collection_path, Cancellable ? cancellable = null ) throws Error
Assign a collection to this alias.
public bool store_sync (Schema ? schema, HashTable <string ,string > attributes, string ? collection, string label, Value value, Cancellable ? cancellable = null ) throws Error
Store a secret value in the secret service.
public async int unlock_dbus_paths (string [] paths, Cancellable ? cancellable, out string []? unlocked) throws Error
Unlock items or collections in the secret service.
public int unlock_dbus_paths_sync (string [] paths, Cancellable ? cancellable, out string []? unlocked) throws Error
Unlock items or collections in the secret service.
public int unlock_sync (List <DBusProxy > objects, Cancellable ? cancellable, out List <DBusProxy >? unlocked) throws Error
Unlock items or collections in the secret service.
Inherited Members:
All known members inherited from class GLib.DBusProxy
@new
call
call_sync
call_with_unix_fd_list
call_with_unix_fd_list_sync
create_for_bus
g_bus_type
g_connection
g_default_timeout
g_flags
g_interface_info
g_interface_name
g_name
g_name_owner
g_object_path
g_properties_changed
g_signal
get_cached_property
get_cached_property_names
get_connection
get_default_timeout
get_flags
get_interface_info
get_interface_name
get_name
get_name_owner
get_object_path
set_cached_property
set_default_timeout
set_interface_info
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface GLib.AsyncInitable
All known members inherited from interface GLib.DBusInterface
All known members inherited from interface GLib.Initable
All known members inherited from interface Secret.Backend