1 | /* libsecret - GLib wrapper for Secret Service |
2 | * |
3 | * Copyright 2011 Collabora Ltd. |
4 | * |
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. |
9 | * |
10 | * See the included COPYING file for more information. |
11 | * |
12 | * Author: Stef Walter <stefw@gnome.org> |
13 | */ |
14 | |
15 | #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION) |
16 | #error "Only <libsecret/secret.h> can be included directly." |
17 | #endif |
18 | |
19 | #ifndef __SECRET_PASSWORD_H__ |
20 | #define __SECRET_PASSWORD_H__ |
21 | |
22 | #include <gio/gio.h> |
23 | |
24 | G_BEGIN_DECLS |
25 | |
26 | #include "secret-schema.h" |
27 | #include "secret-types.h" |
28 | |
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; |
37 | |
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); |
46 | |
47 | gboolean secret_password_store_finish (GAsyncResult *result, |
48 | GError **error); |
49 | |
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; |
57 | |
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); |
65 | |
66 | void secret_password_lookup (const SecretSchema *schema, |
67 | GCancellable *cancellable, |
68 | GAsyncReadyCallback callback, |
69 | gpointer user_data, |
70 | ...) G_GNUC_NULL_TERMINATED; |
71 | |
72 | void secret_password_lookupv (const SecretSchema *schema, |
73 | GHashTable *attributes, |
74 | GCancellable *cancellable, |
75 | GAsyncReadyCallback callback, |
76 | gpointer user_data); |
77 | |
78 | gchar * secret_password_lookup_finish (GAsyncResult *result, |
79 | GError **error); |
80 | |
81 | gchar * secret_password_lookup_nonpageable_finish (GAsyncResult *result, |
82 | GError **error); |
83 | |
84 | gchar * secret_password_lookup_sync (const SecretSchema *schema, |
85 | GCancellable *cancellable, |
86 | GError **error, |
87 | ...) G_GNUC_NULL_TERMINATED; |
88 | |
89 | gchar * secret_password_lookup_nonpageable_sync (const SecretSchema *schema, |
90 | GCancellable *cancellable, |
91 | GError **error, |
92 | ...); |
93 | |
94 | gchar * secret_password_lookupv_sync (const SecretSchema *schema, |
95 | GHashTable *attributes, |
96 | GCancellable *cancellable, |
97 | GError **error); |
98 | |
99 | gchar * secret_password_lookupv_nonpageable_sync (const SecretSchema *schema, |
100 | GHashTable *attributes, |
101 | GCancellable *cancellable, |
102 | GError **error); |
103 | |
104 | void secret_password_clear (const SecretSchema *schema, |
105 | GCancellable *cancellable, |
106 | GAsyncReadyCallback callback, |
107 | gpointer user_data, |
108 | ...) G_GNUC_NULL_TERMINATED; |
109 | |
110 | void secret_password_clearv (const SecretSchema *schema, |
111 | GHashTable *attributes, |
112 | GCancellable *cancellable, |
113 | GAsyncReadyCallback callback, |
114 | gpointer user_data); |
115 | |
116 | gboolean secret_password_clear_finish (GAsyncResult *result, |
117 | GError **error); |
118 | |
119 | gboolean secret_password_clear_sync (const SecretSchema* schema, |
120 | GCancellable *cancellable, |
121 | GError **error, |
122 | ...) G_GNUC_NULL_TERMINATED; |
123 | |
124 | gboolean secret_password_clearv_sync (const SecretSchema *schema, |
125 | GHashTable *attributes, |
126 | GCancellable *cancellable, |
127 | GError **error); |
128 | |
129 | void secret_password_free (gchar *password); |
130 | |
131 | void secret_password_wipe (gchar *password); |
132 | |
133 | G_END_DECLS |
134 | |
135 | #endif /* __SECRET_PASSWORD_H___ */ |
136 | |