~ubuntu-branches/ubuntu/natty/gnome-keyring/natty

« back to all changes in this revision

Viewing changes to pkcs11/secret-store/gck-secret-fields.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-02-16 19:00:06 UTC
  • mfrom: (1.1.58 upstream)
  • Revision ID: james.westby@ubuntu.com-20100216190006-cqpnic4zxlkmmi0o
Tags: 2.29.90git20100218-0ubuntu1
Updated to a git snapshot version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * gnome-keyring
 
3
 * 
 
4
 * Copyright (C) 2009 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, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
 * 02111-1307, USA.  
 
20
 */
 
21
 
 
22
#ifndef __GCK_SECRET_FIELDS_H__
 
23
#define __GCK_SECRET_FIELDS_H__
 
24
 
 
25
#include "pkcs11.h"
 
26
 
 
27
#include <glib.h>
 
28
#include <glib-object.h>
 
29
 
 
30
/*
 
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.
 
34
 * 
 
35
 * Each field has a name, and a string value. 
 
36
 * 
 
37
 * Previous versions of gnome-keyring had the notion of attributes
 
38
 * that were integers. In this version everything is a string.
 
39
 * 
 
40
 * Compatibility attributes start with gkr:compat:
 
41
 * 
 
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.
 
45
 * 
 
46
 * gkr:compat:hashed:xxxx  This attribute contains a hashed version
 
47
 * of xxxx. 
 
48
 */
 
49
 
 
50
#define         GCK_BOXED_SECRET_FIELDS                       (gck_secret_fields_boxed_type ())
 
51
 
 
52
GType           gck_secret_fields_boxed_type                  (void);
 
53
 
 
54
GHashTable*     gck_secret_fields_new                         (void);
 
55
 
 
56
void            gck_secret_fields_add                         (GHashTable *fields,
 
57
                                                               const gchar *name,
 
58
                                                               const gchar *value);
 
59
 
 
60
void            gck_secret_fields_take                        (GHashTable *fields,
 
61
                                                               gchar *name,
 
62
                                                               gchar *value);
 
63
 
 
64
const gchar*    gck_secret_fields_get                         (GHashTable *fields,
 
65
                                                               const gchar *name);
 
66
 
 
67
CK_RV           gck_secret_fields_parse                       (CK_ATTRIBUTE_PTR attr,
 
68
                                                               GHashTable **fields);
 
69
 
 
70
CK_RV           gck_secret_fields_serialize                   (CK_ATTRIBUTE_PTR attr,
 
71
                                                               GHashTable *fields);
 
72
 
 
73
gboolean        gck_secret_fields_match                       (GHashTable *haystack,
 
74
                                                               GHashTable *needle);
 
75
 
 
76
GList*          gck_secret_fields_get_names                   (GHashTable *fields);
 
77
 
 
78
/* COMPAT ------------------------------------------------------------------------ */
 
79
 
 
80
GList*          gck_secret_fields_get_compat_hashed_names     (GHashTable *fields);
 
81
 
 
82
void            gck_secret_fields_add_compat_uint32           (GHashTable *fields, 
 
83
                                                               const gchar *name,
 
84
                                                               guint32 value);
 
85
 
 
86
gboolean        gck_secret_fields_get_compat_uint32           (GHashTable *fields,
 
87
                                                               const gchar *name,
 
88
                                                               guint32 *value);
 
89
 
 
90
void            gck_secret_fields_add_compat_hashed_string    (GHashTable *fields, 
 
91
                                                               const gchar *name,
 
92
                                                               const gchar *value);
 
93
 
 
94
gboolean        gck_secret_fields_get_compat_hashed_string    (GHashTable *fields, 
 
95
                                                               const gchar *name,
 
96
                                                               gchar **value);
 
97
 
 
98
void            gck_secret_fields_add_compat_hashed_uint32    (GHashTable *fields, 
 
99
                                                               const gchar *name, 
 
100
                                                               guint32 value);
 
101
 
 
102
gboolean        gck_secret_fields_get_compat_hashed_uint32    (GHashTable *fields, 
 
103
                                                               const gchar *name,
 
104
                                                               guint32 *value);
 
105
 
 
106
#endif /* __GCK_SECRET_FIELDS_H__ */