1 /* GIO - Small GLib wrapper of PKCS#11 for use in GTls
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 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@collabora.co.uk>
15 #ifndef __G_PKCS11_SLOT_H__
16 #define __G_PKCS11_SLOT_H__
20 #include "gpkcs11array.h"
22 #include <p11-kit/pkcs11.h>
23 #include <p11-kit/uri.h>
29 G_PKCS11_ENUMERATE_FAILED,
30 G_PKCS11_ENUMERATE_STOP,
31 G_PKCS11_ENUMERATE_CONTINUE
32 } GPkcs11EnumerateState;
34 #define G_TYPE_PKCS11_SLOT (g_pkcs11_slot_get_type ())
35 #define G_PKCS11_SLOT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_PKCS11_SLOT, GPkcs11Slot))
36 #define G_PKCS11_SLOT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_PKCS11_SLOT, GPkcs11SlotClass))
37 #define G_IS_PKCS11_SLOT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_PKCS11_SLOT))
38 #define G_IS_PKCS11_SLOT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_PKCS11_SLOT))
39 #define G_PKCS11_SLOT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_PKCS11_SLOT, GPkcs11SlotClass))
41 typedef struct _GPkcs11SlotPrivate GPkcs11SlotPrivate;
42 typedef struct _GPkcs11SlotClass GPkcs11SlotClass;
43 typedef struct _GPkcs11Slot GPkcs11Slot;
45 struct _GPkcs11SlotClass
47 GObjectClass parent_class;
52 GObject parent_instance;
53 GPkcs11SlotPrivate *priv;
56 typedef gboolean (*GPkcs11Accumulator) (gpointer result,
59 GType g_pkcs11_slot_get_type (void) G_GNUC_CONST;
61 GPkcs11EnumerateState g_pkcs11_slot_enumerate (GPkcs11Slot *self,
62 GTlsInteraction *interaction,
63 CK_ATTRIBUTE_PTR match,
65 gboolean match_private,
66 const CK_ATTRIBUTE_TYPE *attr_types,
67 guint attr_types_length,
68 GPkcs11Accumulator accumulator,
70 GCancellable *cancellable,
73 gboolean g_pkcs11_slot_get_token_info (GPkcs11Slot *self,
74 CK_TOKEN_INFO_PTR token_info);
76 gboolean g_pkcs11_slot_matches_uri (GPkcs11Slot *self,
81 #endif /* __G_PKCS11_SLOT_H___ */