Method

SecretServicecreate_collection_dbus_path_sync

Declaration [src]

gchar*
secret_service_create_collection_dbus_path_sync (
  SecretService* self,
  GHashTable* properties,
  const gchar* alias,
  SecretCollectionCreateFlags flags,
  GCancellable* cancellable,
  GError** error
)

Description [src]

Create a new collection in the secret service and return its path.

Using this method requires that you setup a correct hash table of D-Bus properties for the new collection. You may prefer to use secret_collection_create() which does handles this for you.

An alias is a well-known tag for a collection, such as ‘default’ (ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If a collection with the alias already exists, then instead of creating a new collection, the existing collection will be returned. If no collection with this alias exists, then a new collection will be created and this alias will be assigned to it.

properties is a set of properties for the new collection. The keys in the hash table should be interface.property strings like org.freedesktop.Secret.Collection.Label. The values in the hash table should be GVariant values of the properties.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. secret_service_prompt() will be used to handle any prompts that are required.

Stability: Unstable

This method is not directly available to language bindings.

Parameters

properties

Type: GHashTable

Hash table of D-Bus properties for the new collection.

The data is owned by the caller of the function.
alias

Type: const gchar*

An alias to check for before creating the new collection, or to assign to the new collection.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
flags

Type: SecretCollectionCreateFlags

Not currently used.

cancellable

Type: GCancellable

Optional cancellation object.

The argument can be NULL.
The data is owned by the caller of the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gchar*

A new string containing the D-Bus object path of the collection.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.