4
* Copyright (C) 2009 Stefan Walter
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.
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.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22
#ifndef __GCK_SECRET_FIELDS_H__
23
#define __GCK_SECRET_FIELDS_H__
28
#include <glib-object.h>
31
* This represents a set of attributes from the secrets API. We
32
* call them 'fields' here, so they don't get mixed up with the
33
* PKCS#11 API's notion of attributes.
35
* Each field has a name, and a string value.
37
* Previous versions of gnome-keyring had the notion of attributes
38
* that were integers. In this version everything is a string.
40
* Compatibility attributes start with gkr:compat:
42
* gkr:compat:uint32:xxxx The presence of this attribute means that
43
* the xxxx attribute is a uint32 in older versions of gnome-keyring.
44
* The value of this attribute is insignificant.
46
* gkr:compat:hashed:xxxx This attribute contains a hashed version
50
#define GCK_BOXED_SECRET_FIELDS (gck_secret_fields_boxed_type ())
52
GType gck_secret_fields_boxed_type (void);
54
GHashTable* gck_secret_fields_new (void);
56
void gck_secret_fields_add (GHashTable *fields,
60
void gck_secret_fields_take (GHashTable *fields,
64
const gchar* gck_secret_fields_get (GHashTable *fields,
67
CK_RV gck_secret_fields_parse (CK_ATTRIBUTE_PTR attr,
70
CK_RV gck_secret_fields_serialize (CK_ATTRIBUTE_PTR attr,
73
gboolean gck_secret_fields_match (GHashTable *haystack,
76
GList* gck_secret_fields_get_names (GHashTable *fields);
78
/* COMPAT ------------------------------------------------------------------------ */
80
GList* gck_secret_fields_get_compat_hashed_names (GHashTable *fields);
82
void gck_secret_fields_add_compat_uint32 (GHashTable *fields,
86
gboolean gck_secret_fields_get_compat_uint32 (GHashTable *fields,
90
void gck_secret_fields_add_compat_hashed_string (GHashTable *fields,
94
gboolean gck_secret_fields_get_compat_hashed_string (GHashTable *fields,
98
void gck_secret_fields_add_compat_hashed_uint32 (GHashTable *fields,
102
gboolean gck_secret_fields_get_compat_hashed_uint32 (GHashTable *fields,
106
#endif /* __GCK_SECRET_FIELDS_H__ */