## e-secret-store

e-secret-store — Interface to store secrets

## Functions

gboolean | e_secret_store_store_sync ()
gboolean | e_secret_store_lookup_sync ()
gboolean | e_secret_store_delete_sync ()

## Includes

    #include <libedataserver/libedataserver.h>

## Description

The e-secret-store API provides an interface to store, lookup and delete secrets from the keyring.

## Functions

### e_secret_store_store_sync ()

    gboolean
    e_secret_store_store_sync (const gchar *uid,
                               const gchar *secret,
                               const gchar *label,
                               gboolean permanently,
                               GCancellable *cancellable,
                               GError **error);

Stores the `secret` for the `uid` .

If `permanently` is `TRUE`, the secret is stored in the default keyring. Otherwise the secret is stored in the memory-only session keyring. If an error occurs, the function sets `error` and returns `FALSE`.

#### Parameters

uid | a unique identifier of the secret |
secret | the secret to store |
label | human readable description of the secret |
permanently | store permanently or just for the session |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` on error

Since: 3.18

### e_secret_store_lookup_sync ()

    gboolean
    e_secret_store_lookup_sync (const gchar *uid,
                                gchar **out_secret,
                                GCancellable *cancellable,
                                GError **error);

Looks up a secret for the `uid` . Both the default and session keyrings are queried.

Note the boolean return value indicates whether the lookup operation itself completed successfully, not whether the secret was found. If no secret was found, the function will set `out_secret` to `NULL`, but still return `TRUE`. If an error occurs, the function sets `error` and returns `FALSE`.

#### Parameters

uid | a unique identifier of the secret |
out_secret | return location for the secret, or `NULL`. | [out]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` on error

Since: 3.18

### e_secret_store_delete_sync ()

    gboolean
    e_secret_store_delete_sync (const gchar *uid,
                                GCancellable *cancellable,
                                GError **error);

Deletes the secret for `uid` from either the default keyring or session keyring.

Note the boolean return value indicates whether the delete operation itself completed successfully, not whether the secret was found and deleted. If no such secret was found, the function will still return `TRUE`. If an error occurs, the function sets `error` and returns `FALSE`.

#### Parameters

uid | a unique identifier of the secret |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` on error

Since: 3.18