Debian Codegraph @

pkcs11/gkm/gkm-util.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_UTIL_H_
22 #define GKM_UTIL_H_
23
24 #include <glib.h>
25
26 #include <gcrypt.h>
27
28 #include "pkcs11/pkcs11.h"
29
30 typedef struct _GkmMemory {
31 gconstpointer data;
32 gsize n_data;
33 } GkmMemory;
34
35 GkmMemory* gkm_util_memory_new (gconstpointer data,
36 gsize n_data);
37
38 guint gkm_util_memory_hash (gconstpointer memory);
39
40 gboolean gkm_util_memory_equal (gconstpointer memory_1,
41 gconstpointer memory_2);
42
43 void gkm_util_memory_free (gpointer memory);
44
45 guint gkm_util_ulong_hash (gconstpointer ptr_to_ulong);
46
47 gboolean gkm_util_ulong_equal (gconstpointer ptr_to_ulong_1,
48 gconstpointer ptr_to_ulong_2);
49
50 gulong* gkm_util_ulong_alloc (gulong value);
51
52 void gkm_util_ulong_free (gpointer ptr_to_ulong);
53
54 CK_RV gkm_util_return_data (CK_VOID_PTR output,
55 CK_ULONG_PTR n_output,
56 gconstpointer input,
57 gsize n_input);
58
59 CK_RV gkm_attribute_set_mpi (CK_ATTRIBUTE_PTR attr,
60 gcry_mpi_t mpi);
61
62 CK_ULONG gkm_util_next_handle (void);
63
64 void gkm_util_dispose_unref (gpointer object);
65
66 gchar * gkm_util_locate_keyrings_directory (void);
67
68 #endif /* GKM_UTIL_H_ */