| 1 |
/* |
| 2 |
* gnome-keyring |
| 3 |
* |
| 4 |
* Copyright (C) 2009 Stefan Walter |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU Lesser General Public License as |
| 8 |
* published by the Free Software Foundation; either version 2.1 of |
| 9 |
* the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, but |
| 12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Lesser General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Lesser General Public |
| 17 |
* License along with this program; if not, see |
| 18 |
* <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef __GKM_CREDENTIAL_H__ |
| 22 |
#define __GKM_CREDENTIAL_H__ |
| 23 |
|
| 24 |
#include <glib-object.h> |
| 25 |
|
| 26 |
#include "gkm-object.h" |
| 27 |
#include "gkm-types.h" |
| 28 |
|
| 29 |
#define GKM_FACTORY_CREDENTIAL (gkm_credential_get_factory ()) |
| 30 |
|
| 31 |
#define GKM_TYPE_CREDENTIAL (gkm_credential_get_type ()) |
| 32 |
#define GKM_CREDENTIAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKM_TYPE_CREDENTIAL, GkmCredential)) |
| 33 |
#define GKM_CREDENTIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKM_TYPE_CREDENTIAL, GkmCredentialClass)) |
| 34 |
#define GKM_IS_CREDENTIAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKM_TYPE_CREDENTIAL)) |
| 35 |
#define GKM_IS_CREDENTIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKM_TYPE_CREDENTIAL)) |
| 36 |
#define GKM_CREDENTIAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKM_TYPE_CREDENTIAL, GkmCredentialClass)) |
| 37 |
|
| 38 |
typedef struct _GkmCredentialClass GkmCredentialClass; |
| 39 |
typedef struct _GkmCredentialPrivate GkmCredentialPrivate; |
| 40 |
|
| 41 |
struct _GkmCredential { |
| 42 |
GkmObject parent; |
| 43 |
GkmCredentialPrivate *pv; |
| 44 |
}; |
| 45 |
|
| 46 |
struct _GkmCredentialClass { |
| 47 |
GkmObjectClass parent_class; |
| 48 |
}; |
| 49 |
|
| 50 |
GType gkm_credential_get_type (void); |
| 51 |
|
| 52 |
GkmFactory* gkm_credential_get_factory (void); |
| 53 |
|
| 54 |
CK_RV gkm_credential_create (GkmModule *module, |
| 55 |
GkmManager *manager, |
| 56 |
GkmObject *object, |
| 57 |
CK_UTF8CHAR_PTR pin, |
| 58 |
CK_ULONG n_pin, |
| 59 |
GkmCredential **result); |
| 60 |
|
| 61 |
void gkm_credential_connect (GkmCredential *self, |
| 62 |
GkmObject *object); |
| 63 |
|
| 64 |
GkmSecret* gkm_credential_get_secret (GkmCredential *self); |
| 65 |
|
| 66 |
void gkm_credential_set_secret (GkmCredential *self, |
| 67 |
GkmSecret *login); |
| 68 |
|
| 69 |
const gchar* gkm_credential_get_password (GkmCredential *self, |
| 70 |
gsize *n_password); |
| 71 |
|
| 72 |
GkmObject* gkm_credential_get_object (GkmCredential *self); |
| 73 |
|
| 74 |
gpointer gkm_credential_peek_data (GkmCredential *self, |
| 75 |
GType type); |
| 76 |
|
| 77 |
gpointer gkm_credential_pop_data (GkmCredential *self, |
| 78 |
GType type); |
| 79 |
|
| 80 |
void gkm_credential_set_data (GkmCredential *self, |
| 81 |
GType type, |
| 82 |
gpointer data); |
| 83 |
|
| 84 |
typedef gboolean (*GkmCredentialFunc) (GkmCredential *cred, |
| 85 |
GkmObject *object, |
| 86 |
gpointer user_data); |
| 87 |
|
| 88 |
|
| 89 |
gboolean gkm_credential_for_each (GkmSession *self, |
| 90 |
GkmObject *object, |
| 91 |
GkmCredentialFunc func, |
| 92 |
gpointer user_data); |
| 93 |
|
| 94 |
#endif /* __GKM_CREDENTIAL_H__ */ |