Roll ANGLE 3cd438d1..1ea584c56.
[chromium-blink-merge.git] / third_party / libsecret / secret-password.h
blobd47abb34e0694083b6909f9d84e9bd7dbd0946e4
1 /* libsecret - GLib wrapper for Secret Service
3 * Copyright 2011 Collabora Ltd.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; either version 2.1 of the licence or (at
8 * your option) any later version.
10 * See the included COPYING file for more information.
12 * Author: Stef Walter <stefw@gnome.org>
15 #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION)
16 #error "Only <libsecret/secret.h> can be included directly."
17 #endif
19 #ifndef __SECRET_PASSWORD_H__
20 #define __SECRET_PASSWORD_H__
22 #include <gio/gio.h>
24 G_BEGIN_DECLS
26 #include "secret-schema.h"
27 #include "secret-types.h"
29 void secret_password_store (const SecretSchema *schema,
30 const gchar *collection,
31 const gchar *label,
32 const gchar *password,
33 GCancellable *cancellable,
34 GAsyncReadyCallback callback,
35 gpointer user_data,
36 ...) G_GNUC_NULL_TERMINATED;
38 void secret_password_storev (const SecretSchema *schema,
39 GHashTable *attributes,
40 const gchar *collection,
41 const gchar *label,
42 const gchar *password,
43 GCancellable *cancellable,
44 GAsyncReadyCallback callback,
45 gpointer user_data);
47 gboolean secret_password_store_finish (GAsyncResult *result,
48 GError **error);
50 gboolean secret_password_store_sync (const SecretSchema *schema,
51 const gchar *collection,
52 const gchar *label,
53 const gchar *password,
54 GCancellable *cancellable,
55 GError **error,
56 ...) G_GNUC_NULL_TERMINATED;
58 gboolean secret_password_storev_sync (const SecretSchema *schema,
59 GHashTable *attributes,
60 const gchar *collection,
61 const gchar *label,
62 const gchar *password,
63 GCancellable *cancellable,
64 GError **error);
66 void secret_password_lookup (const SecretSchema *schema,
67 GCancellable *cancellable,
68 GAsyncReadyCallback callback,
69 gpointer user_data,
70 ...) G_GNUC_NULL_TERMINATED;
72 void secret_password_lookupv (const SecretSchema *schema,
73 GHashTable *attributes,
74 GCancellable *cancellable,
75 GAsyncReadyCallback callback,
76 gpointer user_data);
78 gchar * secret_password_lookup_finish (GAsyncResult *result,
79 GError **error);
81 gchar * secret_password_lookup_nonpageable_finish (GAsyncResult *result,
82 GError **error);
84 gchar * secret_password_lookup_sync (const SecretSchema *schema,
85 GCancellable *cancellable,
86 GError **error,
87 ...) G_GNUC_NULL_TERMINATED;
89 gchar * secret_password_lookup_nonpageable_sync (const SecretSchema *schema,
90 GCancellable *cancellable,
91 GError **error,
92 ...);
94 gchar * secret_password_lookupv_sync (const SecretSchema *schema,
95 GHashTable *attributes,
96 GCancellable *cancellable,
97 GError **error);
99 gchar * secret_password_lookupv_nonpageable_sync (const SecretSchema *schema,
100 GHashTable *attributes,
101 GCancellable *cancellable,
102 GError **error);
104 void secret_password_clear (const SecretSchema *schema,
105 GCancellable *cancellable,
106 GAsyncReadyCallback callback,
107 gpointer user_data,
108 ...) G_GNUC_NULL_TERMINATED;
110 void secret_password_clearv (const SecretSchema *schema,
111 GHashTable *attributes,
112 GCancellable *cancellable,
113 GAsyncReadyCallback callback,
114 gpointer user_data);
116 gboolean secret_password_clear_finish (GAsyncResult *result,
117 GError **error);
119 gboolean secret_password_clear_sync (const SecretSchema* schema,
120 GCancellable *cancellable,
121 GError **error,
122 ...) G_GNUC_NULL_TERMINATED;
124 gboolean secret_password_clearv_sync (const SecretSchema *schema,
125 GHashTable *attributes,
126 GCancellable *cancellable,
127 GError **error);
129 void secret_password_free (gchar *password);
131 void secret_password_wipe (gchar *password);
133 G_END_DECLS
135 #endif /* __SECRET_PASSWORD_H___ */