1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * This file is part of gsignond
6 * Copyright (C) 2012 Intel Corporation.
8 * Contact: Imran Zaman <imran.zaman@linux.intel.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 #ifndef __GSIGNOND_SECRET_STORAGE_H__
27 #define __GSIGNOND_SECRET_STORAGE_H__
30 #include <glib-object.h>
32 #include <gsignond/gsignond-config.h>
33 #include <gsignond/gsignond-credentials.h>
40 #define GSIGNOND_TYPE_SECRET_STORAGE \
41 (gsignond_secret_storage_get_type ())
42 #define GSIGNOND_SECRET_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
43 GSIGNOND_TYPE_SECRET_STORAGE, \
44 GSignondSecretStorage))
45 #define GSIGNOND_IS_SECRET_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
46 GSIGNOND_TYPE_SECRET_STORAGE))
47 #define GSIGNOND_SECRET_STORAGE_CLASS(klass) \
48 (G_TYPE_CHECK_CLASS_CAST ((klass), \
49 GSIGNOND_TYPE_SECRET_STORAGE, \
50 GSignondSecretStorageClass))
51 #define GSIGNOND_IS_SECRET_STORAGE_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
53 GSIGNOND_TYPE_SECRET_STORAGE))
54 #define GSIGNOND_SECRET_STORAGE_GET_CLASS(obj) \
55 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
56 GSIGNOND_TYPE_SECRET_STORAGE, \
57 GSignondSecretStorageClass))
59 typedef struct _GSignondSecretStoragePrivate GSignondSecretStoragePrivate;
62 GObject parent_instance;
65 GSignondConfig *config;
66 GSignondSecretStoragePrivate *priv;
67 } GSignondSecretStorage;
70 GObjectClass parent_class;
75 * See #gsignond_secret_storage_open_db.
78 (*open_db) (GSignondSecretStorage *self);
83 * See #gsignond_secret_storage_close_db.
86 (*close_db) (GSignondSecretStorage *self);
91 * See #gsignond_secret_storage_clear_db.
94 (*clear_db) (GSignondSecretStorage *self);
99 * See #gsignond_secret_storage_is_open_db.
102 (*is_open_db) (GSignondSecretStorage *self);
107 * See #gsignond_secret_storage_load_credentials.
110 (*load_credentials) (
111 GSignondSecretStorage *self,
115 * update_credentials:
117 * See #gsignond_secret_storage_update_credentials.
120 (*update_credentials) (
121 GSignondSecretStorage *self,
122 GSignondCredentials* creds);
125 * remove_credentials:
127 * See #gsignond_secret_storage_remove_credentials.
130 (*remove_credentials) (
131 GSignondSecretStorage *self,
137 * See #gsignond_secret_storage_check_credentials.
140 (*check_credentials) (
141 GSignondSecretStorage *self,
142 GSignondCredentials* creds);
147 * See #gsignond_secret_storage_load_data.
152 GSignondSecretStorage *self,
154 const guint32 method);
159 * See #gsignond_secret_storage_update_data.
163 GSignondSecretStorage *self,
165 const guint32 method,
171 * See #gsignond_secret_storage_remove_data.
175 GSignondSecretStorage *self,
177 const guint32 method);
179 } GSignondSecretStorageClass;
181 /* used by GSIGNOND_TYPE_SECRET_STORAGE */
183 gsignond_secret_storage_get_type (void);
186 gsignond_secret_storage_open_db (GSignondSecretStorage *self);
189 gsignond_secret_storage_close_db (GSignondSecretStorage *self);
192 gsignond_secret_storage_clear_db (GSignondSecretStorage *self);
195 gsignond_secret_storage_is_open_db (GSignondSecretStorage *self);
198 gsignond_secret_storage_load_credentials (
199 GSignondSecretStorage *self,
203 gsignond_secret_storage_update_credentials (
204 GSignondSecretStorage *self,
205 GSignondCredentials* creds);
208 gsignond_secret_storage_remove_credentials (
209 GSignondSecretStorage *self,
213 gsignond_secret_storage_check_credentials (
214 GSignondSecretStorage *self,
215 GSignondCredentials* creds);
218 gsignond_secret_storage_load_data (
219 GSignondSecretStorage *self,
221 const guint32 method);
224 gsignond_secret_storage_update_data (
225 GSignondSecretStorage *self,
227 const guint32 method,
231 gsignond_secret_storage_remove_data (
232 GSignondSecretStorage *self,
234 const guint32 method);
237 gsignond_secret_storage_set_last_error (GSignondSecretStorage *self,
241 gsignond_secret_storage_get_last_error (GSignondSecretStorage *self);
244 gsignond_secret_storage_clear_last_error (GSignondSecretStorage *self);
249 #endif /* __GSIGNOND_SECRET_STORAGE_H__ */