1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
/* gck-private.h - the GObject PKCS#11 wrapper library
4
Copyright (C) 2008, Stefan Walter
6
The Gnome Keyring Library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public License as
8
published by the Free Software Foundation; either version 2 of the
9
License, or (at your option) any later version.
11
The Gnome Keyring Library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public
17
License along with the Gnome Library; see the file COPYING.LIB. If not,
18
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
Boston, MA 02111-1307, USA.
21
Author: Stef Walter <nielsen@memberwebs.com>
24
#ifndef GCK_PRIVATE_H_
25
#define GCK_PRIVATE_H_
30
#include <glib-object.h>
35
/* ---------------------------------------------------------------------------
39
void _gck_attributes_lock (GckAttributes *attrs);
41
void _gck_attributes_unlock (GckAttributes *attrs);
43
CK_ATTRIBUTE_PTR _gck_attributes_prepare_in (GckAttributes *attrs,
44
CK_ULONG_PTR n_attrs);
46
CK_ATTRIBUTE_PTR _gck_attributes_commit_in (GckAttributes *attrs,
47
CK_ULONG_PTR n_attrs);
49
CK_ATTRIBUTE_PTR _gck_attributes_commit_out (GckAttributes *attrs,
50
CK_ULONG_PTR n_attrs);
52
/* ----------------------------------------------------------------------------
56
guint _gck_ulong_hash (gconstpointer v);
58
gboolean _gck_ulong_equal (gconstpointer v1,
61
/* ----------------------------------------------------------------------------
65
gboolean _gck_module_fire_authenticate_slot (GckModule *module,
70
gboolean _gck_module_fire_authenticate_object (GckModule *module,
75
gboolean _gck_module_info_match (GckModuleInfo *match,
76
GckModuleInfo *module_info);
78
/* -----------------------------------------------------------------------------
82
GckEnumerator* _gck_enumerator_new (GList *modules,
83
guint session_options,
84
GckUriInfo *uri_info);
86
/* ----------------------------------------------------------------------------
90
gboolean _gck_token_info_match (GckTokenInfo *match,
93
/* ----------------------------------------------------------------------------
97
GckUriInfo* _gck_uri_info_new (void);
99
/* ----------------------------------------------------------------------------
103
typedef CK_RV (*GckPerformFunc) (gpointer call_data);
104
typedef gboolean (*GckCompleteFunc) (gpointer call_data, CK_RV result);
106
typedef struct _GckCall GckCall;
108
typedef struct _GckArguments {
111
/* For the call function to use */
112
CK_FUNCTION_LIST_PTR pkcs11;
117
#define GCK_MECHANISM_EMPTY { 0UL, NULL, 0 }
119
#define GCK_ARGUMENTS_INIT { NULL, NULL, 0 }
121
#define GCK_TYPE_CALL (_gck_call_get_type())
122
#define GCK_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCK_TYPE_CALL, GckCall))
123
#define GCK_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCK_TYPE_CALL, GckCall))
124
#define GCK_IS_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCK_TYPE_CALL))
125
#define GCK_IS_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCK_TYPE_CALL))
126
#define GCK_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCK_TYPE_CALL, GckCallClass))
128
typedef struct _GckCallClass GckCallClass;
130
GType _gck_call_get_type (void) G_GNUC_CONST;
132
#define _gck_call_arguments(call, type) (type*)(_gck_call_get_arguments (GCK_CALL (call)))
134
gpointer _gck_call_get_arguments (GckCall *call);
136
void _gck_call_uninitialize (void);
138
gboolean _gck_call_sync (gpointer object,
142
GCancellable *cancellable,
145
gpointer _gck_call_async_prep (gpointer object,
150
gpointer destroy_func);
152
GckCall* _gck_call_async_ready (gpointer args,
153
GCancellable *cancellable,
154
GAsyncReadyCallback callback,
157
void _gck_call_async_go (GckCall *call);
159
void _gck_call_async_ready_go (gpointer args,
160
GCancellable *cancellable,
161
GAsyncReadyCallback callback,
164
void _gck_call_async_short (GckCall *call,
167
gboolean _gck_call_basic_finish (GAsyncResult *result,
170
void _gck_call_async_object (GckCall *call,
173
#endif /* GCK_PRIVATE_H_ */