## DBus Path Related Functions DBus Path Related Functions — Secret Service functions which operate on DBus object paths |

## Functions

void | secret_collection_new_for_dbus_path ()
SecretCollection * | secret_collection_new_for_dbus_path_finish ()
SecretCollection * | secret_collection_new_for_dbus_path_sync ()
void | secret_item_new_for_dbus_path ()
SecretItem * | secret_item_new_for_dbus_path_finish ()
SecretItem * | secret_item_new_for_dbus_path_sync ()
const gchar * | secret_service_get_session_dbus_path ()
void | secret_service_search_for_dbus_paths ()
gboolean | secret_service_search_for_dbus_paths_finish ()
gboolean | secret_service_search_for_dbus_paths_sync ()
void | secret_collection_search_for_dbus_paths ()
gchar ** | secret_collection_search_for_dbus_paths_finish ()
gchar ** | secret_collection_search_for_dbus_paths_sync ()
void | secret_service_get_secrets_for_dbus_paths ()
GHashTable * | secret_service_get_secrets_for_dbus_paths_finish ()
GHashTable * | secret_service_get_secrets_for_dbus_paths_sync ()
void | secret_service_get_secret_for_dbus_path ()
SecretValue * | secret_service_get_secret_for_dbus_path_finish ()
SecretValue * | secret_service_get_secret_for_dbus_path_sync ()
void | secret_service_lock_dbus_paths ()
gint | secret_service_lock_dbus_paths_finish ()
gint | secret_service_lock_dbus_paths_sync ()
void | secret_service_unlock_dbus_paths ()
gint | secret_service_unlock_dbus_paths_finish ()
gint | secret_service_unlock_dbus_paths_sync ()
void | secret_service_prompt_at_dbus_path ()
GVariant * | secret_service_prompt_at_dbus_path_finish ()
GVariant * | secret_service_prompt_at_dbus_path_sync ()
void | secret_service_create_collection_dbus_path ()
gchar * | secret_service_create_collection_dbus_path_finish ()
gchar * | secret_service_create_collection_dbus_path_sync ()
void | secret_service_create_item_dbus_path ()
gchar * | secret_service_create_item_dbus_path_finish ()
gchar * | secret_service_create_item_dbus_path_sync ()
void | secret_service_delete_item_dbus_path ()
gboolean | secret_service_delete_item_dbus_path_finish ()
gboolean | secret_service_delete_item_dbus_path_sync ()
void | secret_service_read_alias_dbus_path ()
gchar * | secret_service_read_alias_dbus_path_finish ()
gchar * | secret_service_read_alias_dbus_path_sync ()
void | secret_service_set_alias_to_dbus_path ()
gboolean | secret_service_set_alias_to_dbus_path_finish ()
gboolean | secret_service_set_alias_to_dbus_path_sync ()
GVariant * | secret_service_encode_dbus_secret ()
SecretValue * | secret_service_decode_dbus_secret ()

## Includes

    #include <libsecret/secret.h>

## Description

These are low level functions which operate on DBus object paths of collections or items, instead of the SecretCollection or SecretItem objects themselves.

You can use these functions if you wish to manage access to the secret service using the DBus API directly, and only wish to use a few calls in libsecret.

## Functions

### secret_collection_new_for_dbus_path ()

    void
    secret_collection_new_for_dbus_path (SecretService *service,
                                         const gchar *collection_path,
                                         SecretCollectionFlags flags,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

Get a new collection proxy for a collection in the secret service.

If `service` is NULL, then `secret_service_get()` will be called to get the default SecretService proxy.

This method will return immediately and complete asynchronously.

[skip]

#### Parameters

service | a secret service object. | [allow-none]
collection_path | the D-Bus path of the collection |
flags | options for the collection initialization |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_collection_new_for_dbus_path_finish ()

    SecretCollection *
    secret_collection_new_for_dbus_path_finish
                                   (GAsyncResult *result,
                                    GError **error);

Finish asynchronous operation to get a new collection proxy for a collection in the secret service.

[skip]

#### Parameters

result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

the new collection, which should be unreferenced with `g_object_unref()`.

[transfer full]

### secret_collection_new_for_dbus_path_sync ()

    SecretCollection *
    secret_collection_new_for_dbus_path_sync
                                   (SecretService *service,
                                    const gchar *collection_path,
                                    SecretCollectionFlags flags,
                                    GCancellable *cancellable,
                                    GError **error);

Get a new collection proxy for a collection in the secret service.

If `service` is NULL, then `secret_service_get_sync()` will be called to get the default SecretService proxy.

This method may block indefinitely and should not be used in user interface threads.

[skip]

#### Parameters

service | a secret service object. | [allow-none]
collection_path | the D-Bus path of the collection |
flags | options for the collection initialization |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

the new collection, which should be unreferenced with `g_object_unref()`.

[transfer full]

Stability Level: Unstable

### secret_item_new_for_dbus_path ()

    void
    secret_item_new_for_dbus_path (SecretService *service,
                                   const gchar *item_path,
                                   SecretItemFlags flags,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Get a new item proxy for a secret item in the secret service.

If `service` is NULL, then `secret_service_get()` will be called to get the default SecretService proxy.

This method will return immediately and complete asynchronously.

[skip]

#### Parameters

service | a secret service object. | [allow-none]
item_path | the D-Bus path of the collection |
flags | initialization flags for the new item |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_item_new_for_dbus_path_finish ()

    SecretItem *
    secret_item_new_for_dbus_path_finish (GAsyncResult *result,
                                          GError **error);

Finish asynchronous operation to get a new item proxy for an secret item in the secret service.

[skip]

#### Parameters

result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

the new item, which should be unreferenced with `g_object_unref()`.

[transfer full]

Stability Level: Unstable

### secret_item_new_for_dbus_path_sync ()

    SecretItem *
    secret_item_new_for_dbus_path_sync (SecretService *service,
                                        const gchar *item_path,
                                        SecretItemFlags flags,
                                        GCancellable *cancellable,
                                        GError **error);

Get a new item proxy for a secret item in the secret service.

If `service` is NULL, then `secret_service_get_sync()` will be called to get the default SecretService proxy.

This method may block indefinitely and should not be used in user interface threads.

[skip]

#### Parameters

service | a secret service object. | [allow-none]
item_path | the D-Bus path of the item |
flags | initialization flags for the new item |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

the new item, which should be unreferenced with `g_object_unref()`.

[transfer full]

Stability Level: Unstable

### secret_service_get_session_dbus_path ()

    const gchar *
    secret_service_get_session_dbus_path (SecretService *self);

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.

This will be `NULL` if no session has been established. Use `secret_service_ensure_session()` to establish a session.

#### Parameters

self | the secret service proxy |

#### Returns

a string representing the D-Bus object path of the session.

[allow-none]

### secret_service_search_for_dbus_paths ()

    void
    secret_service_search_for_dbus_paths (SecretService *self,
                                          const SecretSchema *schema,
                                          GHashTable *attributes,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Search for items matching the `attributes` , and return their D-Bus object paths. All collections are searched. The `attributes` should be a table of string keys and string values.

This function returns immediately and completes asynchronously.

When your callback is called use `secret_service_search_for_dbus_paths_finish()` to get the results of this function. Only the D-Bus object paths of the items will be returned. If you would like SecretItem objects to be returned instead, then use the `secret_service_search()` function.

[skip]

#### Parameters

self | the secret service |
schema | the schema for the attributes. | [allow-none]
attributes | search for items matching these attributes. | [element-type utf8 utf8]
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_search_for_dbus_paths_finish ()

    gboolean
    secret_service_search_for_dbus_paths_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    gchar ***unlocked,
                                    gchar ***locked,
                                    GError **error);

Complete asynchronous operation to search for items, and return their D-Bus object paths.

Matching items that are locked or unlocked, have their D-Bus paths placed in the `locked` or `unlocked` arrays respectively.

D-Bus object paths of the items will be returned in the `unlocked` or `locked` arrays. If you would to have SecretItem objects to be returned instead, then us the `secret_service_search()` and `secret_service_search_finish()` functions.

[skip]

#### Parameters

self | the secret service |
result | asynchronous result passed to callback |
unlocked | location to place an array of D-Bus object paths for matching items which were locked. | [out][transfer full][array zero-terminated=1][allow-none]
locked | location to place an array of D-Bus object paths for matching items which were locked. | [out][transfer full][array zero-terminated=1][allow-none]
error | location to place error on failure |

#### Returns

whether the search was successful or not

Stability Level: Unstable

### secret_service_search_for_dbus_paths_sync ()

    gboolean
    secret_service_search_for_dbus_paths_sync
                                   (SecretService *self,
                                    const SecretSchema *schema,
                                    GHashTable *attributes,
                                    GCancellable *cancellable,
                                    gchar ***unlocked,
                                    gchar ***locked,
                                    GError **error);

Search for items matching the `attributes` , and return their D-Bus object paths. All collections are searched. The `attributes` should be a table of string keys and string values.

This function may block indefinetely. Use the asynchronous version in user interface threads.

Matching items that are locked or unlocked, have their D-Bus paths placed in the `locked` or `unlocked` arrays respectively.

D-Bus object paths of the items will be returned in the `unlocked` or `locked` arrays. If you would to have SecretItem objects to be returned instead, then use the `secret_service_search_sync()` function.

[skip]

#### Parameters

self | the secret service |
schema | the schema for the attributes. | [allow-none]
attributes | search for items matching these attributes. | [element-type utf8 utf8]
cancellable | optional cancellation object |
unlocked | location to place an array of D-Bus object paths for matching items which were locked. | [out][transfer full][array zero-terminated=1][allow-none]
locked | location to place an array of D-Bus object paths for matching items which were locked. | [out][transfer full][array zero-terminated=1][allow-none]
error | location to place error on failure |

#### Returns

whether the search was successful or not

Stability Level: Unstable

### secret_collection_search_for_dbus_paths ()

    void
    secret_collection_search_for_dbus_paths
                                   (SecretCollection *collection,
                                    const SecretSchema *schema,
                                    GHashTable *attributes,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Search for items in `collection` matching the `attributes` , and return their DBus object paths. Only the specified collection is searched. The `attributes` should be a table of string keys and string values.

This function returns immediately and completes asynchronously.

When your callback is called use `secret_collection_search_for_dbus_paths_finish()` to get the results of this function. Only the DBus object paths of the items will be returned. If you would like SecretItem objects to be returned instead, then use the `secret_collection_search()` function.

[skip]

#### Parameters

collection | the secret collection |
schema | the schema for the attributes. | [allow-none]
attributes | search for items matching these attributes. | [element-type utf8 utf8]
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_collection_search_for_dbus_paths_finish ()

    gchar **
    secret_collection_search_for_dbus_paths_finish
                                   (SecretCollection *collection,
                                    GAsyncResult *result,
                                    GError **error);

Complete asynchronous operation to search for items in a collection.

DBus object paths of the items will be returned. If you would to have SecretItem objects to be returned instead, then use the `secret_collection_search()` and `secret_collection_search_finish()` functions.

[skip]

#### Parameters

collection | the secret collection |
result | asynchronous result passed to callback |
error | location to place error on failure |

#### Returns

an array of DBus object paths for matching items.

[transfer full][array zero-terminated=1]

Stability Level: Unstable

### secret_collection_search_for_dbus_paths_sync ()

    gchar **
    secret_collection_search_for_dbus_paths_sync
                                   (SecretCollection *collection,
                                    const SecretSchema *schema,
                                    GHashTable *attributes,
                                    GCancellable *cancellable,
                                    GError **error);

Search for items matching the `attributes` in `collection` , and return their DBus object paths. The `attributes` should be a table of string keys and string values.

This function may block indefinetely. Use the asynchronous version in user interface threads.

DBus object paths of the items will be returned. If you would to have SecretItem objects to be returned instead, then use the `secret_collection_search_sync()` function.

[skip]

#### Parameters

collection | the secret collection |
schema | the schema for the attributes. | [allow-none]
attributes | search for items matching these attributes. | [element-type utf8 utf8]
cancellable | optional cancellation object |
error | location to place error on failure |

#### Returns

an array of DBus object paths for matching items.

[transfer full][array zero-terminated=1]

Stability Level: Unstable

### secret_service_get_secrets_for_dbus_paths ()

    void
    secret_service_get_secrets_for_dbus_paths
                                   (SecretService *self,
                                    const gchar **item_paths,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Get the secret values for an secret items stored in the service.

The items are represented by their D-Bus object paths. If you already have SecretItem proxy objects, use use `secret_item_load_secrets()` to more simply get their secret values.

This function returns immediately and completes asynchronously.

[skip]

#### Parameters

self | the secret service |
item_paths | the D-Bus paths to items to retrieve secrets for |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_get_secrets_for_dbus_paths_finish ()

    GHashTable *
    secret_service_get_secrets_for_dbus_paths_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Complete asynchronous operation to get the secret values for an secret items stored in the service.

Items that are locked will not be included the results.

[skip]

#### Parameters

self | the secret service |
result | asynchronous result passed to callback |
error | location to place an error on failure |

#### Returns

a newly allocated hash table of item_path keys to SecretValue values.

[transfer full][element-type utf8 Secret.Value]

Stability Level: Unstable

### secret_service_get_secrets_for_dbus_paths_sync ()

    GHashTable *
    secret_service_get_secrets_for_dbus_paths_sync
                                   (SecretService *self,
                                    const gchar **item_paths,
                                    GCancellable *cancellable,
                                    GError **error);

Get the secret values for an secret items stored in the service.

The items are represented by their D-Bus object paths. If you already have SecretItem proxy objects, use use `secret_item_load_secrets_sync()` to more simply get their secret values.

This method may block indefinitely and should not be used in user interface threads.

Items that are locked will not be included the results.

[skip]

#### Parameters

self | the secret service |
item_paths | the D-Bus paths to items to retrieve secrets for |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

a newly allocated hash table of item_path keys to SecretValue values.

[transfer full][element-type utf8 Secret.Value]

Stability Level: Unstable

### secret_service_get_secret_for_dbus_path ()

    void
    secret_service_get_secret_for_dbus_path
                                   (SecretService *self,
                                    const gchar *item_path,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Get the secret value for an secret item stored in the service.

The item is represented by its D-Bus object path. If you already have a SecretItem proxy object, use use `secret_item_get_secret()` to more simply get its secret value.

This function returns immediately and completes asynchronously.

[skip]

#### Parameters

self | the secret service |
item_path | the D-Bus path to item to retrieve secret for |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_get_secret_for_dbus_path_finish ()

    SecretValue *
    secret_service_get_secret_for_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Complete asynchronous operation to get the secret value for an secret item stored in the service.

Will return `NULL` if the item is locked.

[skip]

#### Parameters

self | the secret service |
result | asynchronous result passed to callback |
error | location to place an error on failure |

#### Returns

the newly allocated secret value for the item, which should be released with `secret_value_unref()`.

[transfer full][allow-none]

Stability Level: Unstable

### secret_service_get_secret_for_dbus_path_sync ()

    SecretValue *
    secret_service_get_secret_for_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *item_path,
                                    GCancellable *cancellable,
                                    GError **error);

Get the secret value for an secret item stored in the service.

The item is represented by its D-Bus object path. If you already have a SecretItem proxy object, use use `secret_item_load_secret_sync()` to more simply get its secret value.

This method may block indefinitely and should not be used in user interface threads.

Will return `NULL` if the item is locked.

[skip]

#### Parameters

self | the secret service |
item_path | the D-Bus path to item to retrieve secret for |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

the newly allocated secret value for the item, which should be released with `secret_value_unref()`.

[transfer full][allow-none]

Stability Level: Unstable

### secret_service_lock_dbus_paths ()

    void
    secret_service_lock_dbus_paths (SecretService *self,
                                    const gchar **paths,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Lock items or collections in the secret service.

The items or collections are represented by their D-Bus object paths. If you already have SecretItem and SecretCollection proxy objects, use use `secret_service_lock()` instead.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

This method returns immediately and completes asynchronously. The secret service may prompt the user. `secret_service_prompt()` will be used to handle any prompts that show up.

[skip]

#### Parameters

self | the secret service |
paths | the D-Bus paths for items or collections to lock |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_lock_dbus_paths_finish ()

    gint
    secret_service_lock_dbus_paths_finish (SecretService *self,
                                           GAsyncResult *result,
                                           gchar ***locked,
                                           GError **error);

Complete asynchronous operation to lock items or collections in the secret service.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

[skip]

#### Parameters

self | the secret service |
result | asynchronous result passed to the callback |
locked | location to place array of D-Bus paths of items or collections that were locked. | [out][array zero-terminated=1][transfer full][allow-none]
error | location to place an error on failure |

#### Returns

the number of items or collections that were locked

Stability Level: Unstable

### secret_service_lock_dbus_paths_sync ()

    gint
    secret_service_lock_dbus_paths_sync (SecretService *self,
                                         const gchar **paths,
                                         GCancellable *cancellable,
                                         gchar ***locked,
                                         GError **error);

Lock items or collections in the secret service.

The items or collections are represented by their D-Bus object paths. If you already have SecretItem and SecretCollection proxy objects, use use `secret_service_lock_sync()` instead.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

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 show up.

[skip]

#### Parameters

self | the secret service |
paths | the D-Bus object paths of the items or collections to lock |
cancellable | optional cancellation object |
locked | location to place array of D-Bus paths of items or collections that were locked. | [out][array zero-terminated=1][transfer full][allow-none]
error | location to place an error on failure |

#### Returns

the number of items or collections that were locked

Stability Level: Unstable

### secret_service_unlock_dbus_paths ()

    void
    secret_service_unlock_dbus_paths (SecretService *self,
                                      const gchar **paths,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Unlock items or collections in the secret service.

The items or collections are represented by their D-Bus object paths. If you already have SecretItem and SecretCollection proxy objects, use use `secret_service_unlock()` instead.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

This method returns immediately and completes asynchronously. The secret service may prompt the user. `secret_service_prompt()` will be used to handle any prompts that show up.

[skip]

#### Parameters

self | the secret service |
paths | the D-Bus paths for items or collections to unlock |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_unlock_dbus_paths_finish ()

    gint
    secret_service_unlock_dbus_paths_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    gchar ***unlocked,
                                    GError **error);

Complete asynchronous operation to unlock items or collections in the secret service.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

[skip]

#### Parameters

self | the secret service |
result | asynchronous result passed to the callback |
unlocked | location to place array of D-Bus paths of items or collections that were unlocked. | [out][array zero-terminated=1][transfer full][allow-none]
error | location to place an error on failure |

#### Returns

the number of items or collections that were unlocked

Stability Level: Unstable

### secret_service_unlock_dbus_paths_sync ()

    gint
    secret_service_unlock_dbus_paths_sync (SecretService *self,
                                           const gchar **paths,
                                           GCancellable *cancellable,
                                           gchar ***unlocked,
                                           GError **error);

Unlock items or collections in the secret service.

The items or collections are represented by their D-Bus object paths. If you already have SecretItem and SecretCollection proxy objects, use use `secret_service_unlock_sync()` instead.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

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 show up.

[skip]

#### Parameters

self | the secret service |
paths | the D-Bus object paths of the items or collections to unlock |
cancellable | optional cancellation object |
unlocked | location to place array of D-Bus paths of items or collections that were unlocked. | [out][array zero-terminated=1][transfer full][allow-none]
error | location to place an error on failure |

#### Returns

the number of items or collections that were unlocked

Stability Level: Unstable

### secret_service_prompt_at_dbus_path ()

    void
    secret_service_prompt_at_dbus_path (SecretService *self,
                                        const gchar *prompt_path,
                                        const GVariantType *return_type,
                                        GCancellable *cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);

Perform prompting for a SecretPrompt.

This function is called by other parts of this library to handle prompts for the various actions that can require prompting.

Override the SecretServiceClass `prompt_async` virtual method to change the behavior of the propmting. The default behavior is to simply run `secret_prompt_perform()` on the prompt.

[skip]

#### Parameters

self | the secret service |
prompt_path | the D-Bus object path of the prompt |
return_type | the variant type of the prompt result. | [allow-none]
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_service_prompt_at_dbus_path_finish ()

    GVariant *
    secret_service_prompt_at_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Complete asynchronous operation to perform prompting for a SecretPrompt.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

[skip]

#### Parameters

self | the secret service |
result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

`NULL` if the prompt was dismissed or an error occurred, a variant result if the prompt was successful.

[transfer full]

Stability Level: Unstable

### secret_service_prompt_at_dbus_path_sync ()

    GVariant *
    secret_service_prompt_at_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *prompt_path,
                                    GCancellable *cancellable,
                                    const GVariantType *return_type,
                                    GError **error);

Perform prompting for a SecretPrompt.

Override the SecretServiceClass `prompt_async` virtual method to change the behavior of the propmting. The default behavior is to simply run `secret_prompt_perform()` on the prompt.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

This method may block and should not be used in user interface threads.

[skip]

#### Parameters

self | the secret service |
prompt_path | the D-Bus object path of the prompt |
cancellable | optional cancellation object |
return_type | the variant type of the prompt result. | [allow-none]
error | location to place error on failure |

#### Returns

`NULL` if the prompt was dismissed or an error occurred, a variant result if the prompt was successful.

[transfer full]

Stability Level: Unstable

### secret_service_create_collection_dbus_path ()

    void
    secret_service_create_collection_dbus_path
                                   (SecretService *self,
                                    GHashTable *properties,
                                    const gchar *alias,
                                    SecretCollectionCreateFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

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.

If you wish to have a

This method will return immediately and complete asynchronously. The secret service may prompt the user. `secret_service_prompt()` will be used to handle any prompts that are required.

[skip]

#### Parameters

self | a secret service object |
properties | hash table of properties for the new collection. | [element-type utf8 GLib.Variant]
alias | an alias to check for before creating the new collection, or to assign to the new collection. | [allow-none]
flags | not currently used |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_service_create_collection_dbus_path_finish ()

    gchar *
    secret_service_create_collection_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish asynchronous operation to create a new collection in the secret service.

[skip]

#### Parameters

self | a secret service object |
result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

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

[transfer full]

Stability Level: Unstable

### secret_service_create_collection_dbus_path_sync ()

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

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.

[skip]

#### Parameters

self | a secret service object |
properties | hash table of D-Bus properties for the new collection. | [element-type utf8 GLib.Variant]
alias | an alias to check for before creating the new collection, or to assign to the new collection. | [allow-none]
flags | not currently used |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

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

[transfer full]

Stability Level: Unstable

### secret_service_create_item_dbus_path ()

    void
    secret_service_create_item_dbus_path (SecretService *self,
                                          const gchar *collection_path,
                                          GHashTable *properties,
                                          SecretValue *value,
                                          SecretItemCreateFlags flags,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Create a new item in a secret service collection and return its D-Bus object path.

It is often easier to use `secret_password_store()` or `secret_item_create()` rather than using this function. Using this method requires that you setup a correct hash table of D-Bus `properties` for the new collection.

If the `flags` contains `SECRET_ITEM_CREATE_REPLACE`, then the secret service will search for an item matching the `attributes` , and update that item instead of creating a new one.

`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.Item.Label`. The values in the hash table should be GVariant values of the properties.

This method will return immediately and complete asynchronously. The secret service may prompt the user. `secret_service_prompt()` will be used to handle any prompts that are required.

[skip]

#### Parameters

self | a secret service object |
collection_path | the D-Bus object path of the collection in which to create item |
properties | hash table of D-Bus properties for the new collection. | [element-type utf8 GLib.Variant]
value | the secret value to store in the item |
flags | flags for the creation of the new item |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_service_create_item_dbus_path_finish ()

    gchar *
    secret_service_create_item_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish asynchronous operation to create a new item in the secret service.

[skip]

#### Parameters

self | a secret service object |
result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

a new string containing the D-Bus object path of the item.

[transfer full]

Stability Level: Unstable

### secret_service_create_item_dbus_path_sync ()

    gchar *
    secret_service_create_item_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *collection_path,
                                    GHashTable *properties,
                                    SecretValue *value,
                                    SecretItemCreateFlags flags,
                                    GCancellable *cancellable,
                                    GError **error);

Create a new item in a secret service collection and return its D-Bus object path.

It is often easier to use `secret_password_store_sync()` or `secret_item_create_sync()` rather than using this function. Using this method requires that you setup a correct hash table of D-Bus `properties` for the new collection.

If the `flags` contains `SECRET_ITEM_CREATE_REPLACE`, then the secret service will search for an item matching the `attributes` , and update that item instead of creating a new one.

`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.Item.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.

#### Parameters

self | a secret service object |
collection_path | the D-Bus path of the collection in which to create item |
properties | hash table of D-Bus properties for the new collection. | [element-type utf8 GLib.Variant]
value | the secret value to store in the item |
flags | flags for the creation of the new item |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

a new string containing the D-Bus object path of the item.

[transfer full]

Stability Level: Unstable

### secret_service_delete_item_dbus_path ()

    void
    secret_service_delete_item_dbus_path (SecretService *self,
                                          const gchar *item_path,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Delete a secret item from the secret service.

The item is represented by its D-Bus object path. If you already have a SecretItem proxy objects, use use `secret_item_delete()` instead.

This method will return immediately and complete asynchronously.

[skip]

#### Parameters

self | the secret service |
item_path | the D-Bus path of item to delete |
cancellable | optional cancellation object |
callback | called when the operation completes |
user_data | data to be passed to the callback |

Stability Level: Unstable

### secret_service_delete_item_dbus_path_finish ()

    gboolean
    secret_service_delete_item_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Complete an asynchronous operation to delete a secret item from the secret service.

[skip]

#### Parameters

self | the secret service |
result | the asynchronous result passed to the callback |
error | location to place an error on failure |

#### Returns

whether the deletion was successful or not

Stability Level: Unstable

### secret_service_delete_item_dbus_path_sync ()

    gboolean
    secret_service_delete_item_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *item_path,
                                    GCancellable *cancellable,
                                    GError **error);

Delete a secret item from the secret service.

The item is represented by its D-Bus object path. If you already have a SecretItem proxy objects, use use `secret_item_delete_sync()` instead.

This method may block indefinitely and should not be used in user interface threads.

[skip]

#### Parameters

self | the secret service |
item_path | the D-Bus path of item to delete |
cancellable | optional cancellation object |
error | location to place an error on failure |

#### Returns

whether the deletion was successful or not

Stability Level: Unstable

### secret_service_read_alias_dbus_path ()

    void
    secret_service_read_alias_dbus_path (SecretService *self,
                                         const gchar *alias,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'. This method looks up the dbus object path of the well known collection.

This method will return immediately and complete asynchronously.

[skip]

#### Parameters

self | a secret service object |
alias | the alias to lookup |
cancellable | optional cancellation object. | [allow-none]
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_read_alias_dbus_path_finish ()

    gchar *
    secret_service_read_alias_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous operation to lookup which collection is assigned to an alias. This method returns the DBus object path of the collection

[skip]

#### Parameters

self | a secret service object |
result | asynchronous result passed to callback |
error | location to place error on failure |

#### Returns

the collection dbus object path, or `NULL` if none assigned to the alias.

[transfer full]

Stability Level: Unstable

### secret_service_read_alias_dbus_path_sync ()

    gchar *
    secret_service_read_alias_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *alias,
                                    GCancellable *cancellable,
                                    GError **error);

Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'. This method returns the dbus object path of the collection.

This method may block and should not be used in user interface threads.

[skip]

#### Parameters

self | a secret service object |
alias | the alias to lookup |
cancellable | optional cancellation object. | [allow-none]
error | location to place error on failure |

#### Returns

the collection dbus object path, or `NULL` if none assigned to the alias.

[transfer full]

Stability Level: Unstable

### secret_service_set_alias_to_dbus_path ()

    void
    secret_service_set_alias_to_dbus_path (SecretService *self,
                                           const gchar *alias,
                                           const gchar *collection_path,
                                           GCancellable *cancellable,
                                           GAsyncReadyCallback callback,
                                           gpointer user_data);

Assign a collection to this alias. Aliases help determine well known collections, such as 'default'. This method takes the dbus object path of the collection to assign to the alias.

This method will return immediately and complete asynchronously.

[skip]

#### Parameters

self | a secret service object |
alias | the alias to assign the collection to |
collection_path | the dbus object path of the collection to assign to the alias. | [allow-none]
cancellable | optional cancellation object. | [allow-none]
callback | called when the operation completes |
user_data | data to pass to the callback |

Stability Level: Unstable

### secret_service_set_alias_to_dbus_path_finish ()

    gboolean
    secret_service_set_alias_to_dbus_path_finish
                                   (SecretService *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous operation to assign a collection to an alias.

[skip]

#### Parameters

self | a secret service object |
result | asynchronous result passed to callback |
error | location to place error on failure |

#### Returns

`TRUE` if successful

Stability Level: Unstable

### secret_service_set_alias_to_dbus_path_sync ()

    gboolean
    secret_service_set_alias_to_dbus_path_sync
                                   (SecretService *self,
                                    const gchar *alias,
                                    const gchar *collection_path,
                                    GCancellable *cancellable,
                                    GError **error);

Assign a collection to this alias. Aliases help determine well known collections, such as 'default'. This method takes the dbus object path of the collection to assign to the alias.

This method may block and should not be used in user interface threads.

[skip]

#### Parameters

self | a secret service object |
alias | the alias to assign the collection to |
collection_path | the dbus object path of the collection to assign to the alias. | [allow-none]
cancellable | optional cancellation object. | [allow-none]
error | location to place error on failure |

#### Returns

`TRUE` if successful

Stability Level: Unstable

### secret_service_encode_dbus_secret ()

    GVariant *
    secret_service_encode_dbus_secret (SecretService *service,
                                       SecretValue *value);

Encodes a SecretValue into GVariant for use with the Secret Service DBus API.

The resulting GVariant will have a `(oayays)` signature.

A session must have already been established by the SecretService.

#### Parameters

service | the service |
value | the secret value |

#### Returns

the encoded secret.

[transfer floating]

### secret_service_decode_dbus_secret ()

    SecretValue *
    secret_service_decode_dbus_secret (SecretService *service,
                                       GVariant *value);

Decode a SecretValue into GVariant received with the Secret Service DBus API.

The GVariant should have a `(oayays)` signature.

A session must have already been established by the SecretService, and the encoded secret must be valid for that session.

#### Parameters

service | the service |
value | the encoded secret |

#### Returns

the decoded secret value.

[transfer full]

## Types and Values