A proxy object representing the Secret Service.
A Service object either represents an implementation of the
`org.freedesktop.Secret` D-Bus service or a
file that is encrypted using a master secret that was provided by the
secret portal.
Normally a single Service object can be shared between multiple callers. The [func@Service.get] method is used
to access this Service object. If a new independent Service object is required, use
[func@Service.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 secret_service_open_session flag
to the [func@Service.get] or [func@Service.open] functions. In order to establish a session on an already existing
Service, use the [method@Service.ensure_session] function.
To search for items, use the [method@Service.search] method.
Multiple collections can exist in the Secret Service, each of which contains secret items. In order to instantiate [class@Collection]
objects which represent those collections while initializing a Service then pass the
secret_service_load_collections flag to the [func@Service.get] or [func@Service.open] functions. In
order to establish a session on an already existing Service, use the [method@Service.load_collections]
function. To access the list of collections use [method@Service.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 [class@Prompt] 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 [vfunc@Service.prompt_async] and [vfunc@Service.prompt_finish] virtual methods of the
Service class.
- 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 [struct@Value] into [struct@GLib.
- 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 [struct@Value] into [struct@GLib.
- 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 [class@Collection] 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 [class@Prompt].
- public virtual async Variant prompt_async (Prompt prompt, VariantType return_type, Cancellable? cancellable) throws Error
called to perform asynchronous prompting when necessary
- public async Variant? prompt_at_dbus_path (string prompt_path, VariantType? return_type, Cancellable? cancellable) throws Error
Perform prompting for a [class@Prompt].
- public Variant? prompt_at_dbus_path_sync (string prompt_path, Cancellable? cancellable, VariantType? return_type) throws Error
Perform prompting for a [class@Prompt].
- public virtual Variant prompt_sync (Prompt prompt, Cancellable? cancellable, VariantType return_type) throws Error
Perform prompting for a [class@Prompt].
- 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.