Secret store interface

Secret store interface — Interface to store secrets

Synopsis

#include <libedataserver/libedataserver.h>

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

Description

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

Details

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.

uid :

a unique identifier of the secret

secret :

the secret to store

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.

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.

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