Debian Codegraph @

pkcs11/gkm/gkm-private-xsa-key.h

raw
1 /*
2 * gnome-keyring
3 *
4 * Copyright (C) 2008 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_PRIVATE_XSA_KEY_H__
22 #define __GKM_PRIVATE_XSA_KEY_H__
23
24 #include <glib-object.h>
25
26 #include "gkm-sexp-key.h"
27 #include "gkm-types.h"
28
29 #define GKM_FACTORY_PRIVATE_XSA_KEY (gkm_private_xsa_key_get_factory ())
30
31 #define GKM_TYPE_PRIVATE_XSA_KEY (gkm_private_xsa_key_get_type ())
32 #define GKM_PRIVATE_XSA_KEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKM_TYPE_PRIVATE_XSA_KEY, GkmPrivateXsaKey))
33 #define GKM_PRIVATE_XSA_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKM_TYPE_PRIVATE_XSA_KEY, GkmPrivateXsaKeyClass))
34 #define GKM_IS_PRIVATE_XSA_KEY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKM_TYPE_PRIVATE_XSA_KEY))
35 #define GKM_IS_PRIVATE_XSA_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKM_TYPE_PRIVATE_XSA_KEY))
36 #define GKM_PRIVATE_XSA_KEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKM_TYPE_PRIVATE_XSA_KEY, GkmPrivateXsaKeyClass))
37
38 typedef struct _GkmPrivateXsaKeyClass GkmPrivateXsaKeyClass;
39 typedef struct _GkmPrivateXsaKeyPrivate GkmPrivateXsaKeyPrivate;
40
41 struct _GkmPrivateXsaKey {
42 GkmSexpKey parent;
43 GkmPrivateXsaKeyPrivate *pv;
44 };
45
46 struct _GkmPrivateXsaKeyClass {
47 GkmSexpKeyClass parent_class;
48 };
49
50 GType gkm_private_xsa_key_get_type (void);
51
52 void gkm_private_xsa_key_set_unlocked_private (GkmPrivateXsaKey *self,
53 GkmSexp *sexp);
54
55 void gkm_private_xsa_key_set_locked_private (GkmPrivateXsaKey *self,
56 GkmCredential *cred,
57 GkmSexp *sexp);
58
59 GkmFactory* gkm_private_xsa_key_get_factory (void);
60
61 GkmSexp* gkm_private_xsa_key_create_sexp (GkmSession *session,
62 GkmTransaction *transaction,
63 CK_ATTRIBUTE_PTR attrs,
64 CK_ULONG n_attrs);
65
66 gboolean gkm_attributes_find_ecc_oid (CK_ATTRIBUTE_PTR attrs,
67 CK_ULONG n_attrs,
68 GQuark *value);
69
70 gboolean gkm_attributes_find_ecc_q (CK_ATTRIBUTE_PTR attrs,
71 CK_ULONG n_attrs,
72 CK_ATTRIBUTE_TYPE type,
73 GBytes **value);
74
75 #endif /* __GKM_PRIVATE_XSA_KEY_H__ */