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

« back to all changes in this revision

Viewing changes to docs/reference/gnome-keyring/html/gnome-keyring-gnome-keyring-password.html

  • 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
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
 
<title>Simple Password Storage</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
7
 
<link rel="home" href="index.html" title="gnome-keyring Reference Manual">
8
 
<link rel="up" href="ch01.html" title="gnome-keyring API Reference">
9
 
<link rel="prev" href="ch01.html" title="gnome-keyring API Reference">
10
 
<link rel="next" href="gnome-keyring-gnome-keyring-keyrings.html" title="Keyrings">
11
 
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
 
<link rel="stylesheet" href="style.css" type="text/css">
13
 
<link rel="chapter" href="ch01.html" title="gnome-keyring API Reference">
14
 
</head>
15
 
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
16
 
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
 
<tr valign="middle">
18
 
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
19
 
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
20
 
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
21
 
<th width="100%" align="center">gnome-keyring Reference Manual</th>
22
 
<td><a accesskey="n" href="gnome-keyring-gnome-keyring-keyrings.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
 
</tr>
24
 
<tr><td colspan="5" class="shortcuts">
25
 
<a href="#gnome-keyring-gnome-keyring-password.synopsis" class="shortcut">Top</a>
26
 
                 | 
27
 
                <a href="#gnome-keyring-gnome-keyring-password.description" class="shortcut">Description</a>
28
 
</td></tr>
29
 
</table>
30
 
<div class="refentry" title="Simple Password Storage">
31
 
<a name="gnome-keyring-gnome-keyring-password"></a><div class="titlepage"></div>
32
 
<div class="refnamediv"><table width="100%"><tr>
33
 
<td valign="top">
34
 
<h2><span class="refentrytitle"><a name="gnome-keyring-gnome-keyring-password.top_of_page"></a>Simple Password Storage</span></h2>
35
 
<p>Simple Password Storage — Store and lookup passwords with a set of attributes.</p>
36
 
</td>
37
 
<td valign="top" align="right"></td>
38
 
</tr></table></div>
39
 
<div class="refsynopsisdiv" title="Synopsis">
40
 
<a name="gnome-keyring-gnome-keyring-password.synopsis"></a><h2>Synopsis</h2>
41
 
<pre class="synopsis">
42
 
                    <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a>;
43
 
extern              const GnomeKeyringPasswordSchema* <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-NETWORK-PASSWORD--CAPS" title="GNOME_KEYRING_NETWORK_PASSWORD">GNOME_KEYRING_NETWORK_PASSWORD</a>;
44
 
#define             <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-DEFAULT--CAPS" title="GNOME_KEYRING_DEFAULT">GNOME_KEYRING_DEFAULT</a>
45
 
#define             <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-SESSION--CAPS" title="GNOME_KEYRING_SESSION">GNOME_KEYRING_SESSION</a>
46
 
<a
47
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
48
 
>gpointer</a>            <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-store-password" title="gnome_keyring_store_password ()">gnome_keyring_store_password</a>        (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
49
 
                                                         const <a
50
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
51
 
>gchar</a> *keyring,
52
 
                                                         const <a
53
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
54
 
>gchar</a> *display_name,
55
 
                                                         const <a
56
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
57
 
>gchar</a> *password,
58
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationDoneCallback" title="GnomeKeyringOperationDoneCallback ()">GnomeKeyringOperationDoneCallback</a> callback,
59
 
                                                         <a
60
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
61
 
>gpointer</a> data,
62
 
                                                         <a
63
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
64
 
>GDestroyNotify</a> destroy_data,
65
 
                                                         ...);
66
 
<a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-store-password-sync" title="gnome_keyring_store_password_sync ()">gnome_keyring_store_password_sync</a>   (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
67
 
                                                         const <a
68
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
69
 
>gchar</a> *keyring,
70
 
                                                         const <a
71
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
72
 
>gchar</a> *display_name,
73
 
                                                         const <a
74
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
75
 
>gchar</a> *password,
76
 
                                                         ...);
77
 
<a
78
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
79
 
>gpointer</a>            <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-find-password" title="gnome_keyring_find_password ()">gnome_keyring_find_password</a>         (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
80
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationGetStringCallback" title="GnomeKeyringOperationGetStringCallback ()">GnomeKeyringOperationGetStringCallback</a> callback,
81
 
                                                         <a
82
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
83
 
>gpointer</a> data,
84
 
                                                         <a
85
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
86
 
>GDestroyNotify</a> destroy_data,
87
 
                                                         ...);
88
 
<a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-find-password-sync" title="gnome_keyring_find_password_sync ()">gnome_keyring_find_password_sync</a>    (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
89
 
                                                         <a
90
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
91
 
>gchar</a> **password,
92
 
                                                         ...);
93
 
<a
94
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
95
 
>gpointer</a>            <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-delete-password" title="gnome_keyring_delete_password ()">gnome_keyring_delete_password</a>       (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
96
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationDoneCallback" title="GnomeKeyringOperationDoneCallback ()">GnomeKeyringOperationDoneCallback</a> callback,
97
 
                                                         <a
98
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
99
 
>gpointer</a> data,
100
 
                                                         <a
101
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
102
 
>GDestroyNotify</a> destroy_data,
103
 
                                                         ...);
104
 
<a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-delete-password-sync" title="gnome_keyring_delete_password_sync ()">gnome_keyring_delete_password_sync</a>  (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
105
 
                                                         ...);
106
 
void                <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-free-password" title="gnome_keyring_free_password ()">gnome_keyring_free_password</a>         (<a
107
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
108
 
>gchar</a> *password);
109
 
</pre>
110
 
</div>
111
 
<div class="refsect1" title="Description">
112
 
<a name="gnome-keyring-gnome-keyring-password.description"></a><h2>Description</h2>
113
 
<p>
114
 
This is a simple API for storing passwords and retrieving passwords in the keyring.
115
 
</p>
116
 
<p>
117
 
Each password is associated with a set of attributes. Attribute values can be either 
118
 
strings or unsigned integers.
119
 
 
120
 
The names and types of allowed attributes for a given password are defined with a 
121
 
schema. Certain schemas are predefined such as <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-NETWORK-PASSWORD--CAPS" title="GNOME_KEYRING_NETWORK_PASSWORD"><code class="literal">GNOME_KEYRING_NETWORK_PASSWORD</code></a>. 
122
 
Additional schemas can be defined via the <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema"><code class="literal">GnomeKeyringPasswordSchema</code></a> structure.
123
 
</p>
124
 
<p>
125
 
Each function accepts a variable list of attributes names and their values. 
126
 
Include a <a
127
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
128
 
><code class="literal">NULL</code></a> to terminate the list of attributes.
129
 
</p>
130
 
<p>
131
 
</p>
132
 
<div class="example">
133
 
<a name="id541948"></a><p class="title"><b>Example 1. Passing attributes to the functions</b></p>
134
 
<div class="example-contents"><pre class="programlisting">
135
 
  res = gnome_keyring_delete_password_sync (GNOME_KEYRING_NETWORK_PASSWORD,
136
 
                                            "user", "me",        // A string attribute
137
 
                                            "server, "example.gnome.org", 
138
 
                                            "port", "8080",      // An integer attribute
139
 
                                            NULL);
140
 
</pre></div>
141
 
</div>
142
 
<p><br class="example-break"></p>
143
 
<p>
144
 
</p>
145
 
</div>
146
 
<div class="refsect1" title="Details">
147
 
<a name="gnome-keyring-gnome-keyring-password.details"></a><h2>Details</h2>
148
 
<div class="refsect2" title="GnomeKeyringPasswordSchema">
149
 
<a name="GnomeKeyringPasswordSchema"></a><h3>GnomeKeyringPasswordSchema</h3>
150
 
<pre class="programlisting">typedef struct {
151
 
        GnomeKeyringItemType item_type;
152
 
        struct {
153
 
                const gchar* name;
154
 
                GnomeKeyringAttributeType type;
155
 
        } attributes[32];
156
 
} GnomeKeyringPasswordSchema;
157
 
</pre>
158
 
<p>
159
 
Describes a password schema. Often you'll want to use a predefined schema such 
160
 
as <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-NETWORK-PASSWORD--CAPS" title="GNOME_KEYRING_NETWORK_PASSWORD"><code class="literal">GNOME_KEYRING_NETWORK_PASSWORD</code></a>.
161
 
</p>
162
 
<p>
163
 
</p>
164
 
<p>
165
 
The last attribute name in a schema must be <a
166
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
167
 
><code class="literal">NULL</code></a>.
168
 
</p>
169
 
<p>
170
 
</p>
171
 
<p>
172
 
</p>
173
 
<pre class="programlisting">
174
 
  GnomeKeyringPasswordSchema my_schema = {
175
 
      GNOME_KEYRING_ITEM_GENERIC_SECRET,
176
 
      { 
177
 
           { "string-attr", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
178
 
           { "uint-attr", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
179
 
           { NULL, 0 }
180
 
      }
181
 
  };
182
 
</pre>
183
 
<p>
184
 
</p>
185
 
<p>
186
 
</p>
187
 
</div>
188
 
<hr>
189
 
<div class="refsect2" title="GNOME_KEYRING_NETWORK_PASSWORD">
190
 
<a name="GNOME-KEYRING-NETWORK-PASSWORD--CAPS"></a><h3>GNOME_KEYRING_NETWORK_PASSWORD</h3>
191
 
<pre class="programlisting">extern const GnomeKeyringPasswordSchema* GNOME_KEYRING_NETWORK_PASSWORD; 
192
 
</pre>
193
 
<p>
194
 
</p>
195
 
<p>
196
 
A predefined schema for network paswsords. It contains the following attributes:
197
 
</p>
198
 
<p>
199
 
</p>
200
 
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
201
 
<li class="listitem">user: A string for the user login.</li>
202
 
<li class="listitem">server: The server being connected to.</li>
203
 
<li class="listitem">protocol: The protocol used to access the server, such as 'http' or 'smb'</li>
204
 
<li class="listitem">domain: A realm or domain, such as a Windows login domain.</li>
205
 
<li class="listitem">port: The network port to used to connect to the server.</li>
206
 
</ul></div>
207
 
<p>
208
 
</p>
209
 
</div>
210
 
<hr>
211
 
<div class="refsect2" title="GNOME_KEYRING_DEFAULT">
212
 
<a name="GNOME-KEYRING-DEFAULT--CAPS"></a><h3>GNOME_KEYRING_DEFAULT</h3>
213
 
<pre class="programlisting">#define GNOME_KEYRING_DEFAULT   NULL
214
 
</pre>
215
 
<p>
216
 
</p>
217
 
<p>
218
 
The default keyring.
219
 
</p>
220
 
<p>
221
 
</p>
222
 
</div>
223
 
<hr>
224
 
<div class="refsect2" title="GNOME_KEYRING_SESSION">
225
 
<a name="GNOME-KEYRING-SESSION--CAPS"></a><h3>GNOME_KEYRING_SESSION</h3>
226
 
<pre class="programlisting">#define GNOME_KEYRING_SESSION   "session"
227
 
</pre>
228
 
<p>
229
 
</p>
230
 
<p>
231
 
A keyring only stored in memory.
232
 
</p>
233
 
<p>
234
 
</p>
235
 
</div>
236
 
<hr>
237
 
<div class="refsect2" title="gnome_keyring_store_password ()">
238
 
<a name="gnome-keyring-store-password"></a><h3>gnome_keyring_store_password ()</h3>
239
 
<pre class="programlisting"><a
240
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
241
 
>gpointer</a>            gnome_keyring_store_password        (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
242
 
                                                         const <a
243
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
244
 
>gchar</a> *keyring,
245
 
                                                         const <a
246
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
247
 
>gchar</a> *display_name,
248
 
                                                         const <a
249
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
250
 
>gchar</a> *password,
251
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationDoneCallback" title="GnomeKeyringOperationDoneCallback ()">GnomeKeyringOperationDoneCallback</a> callback,
252
 
                                                         <a
253
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
254
 
>gpointer</a> data,
255
 
                                                         <a
256
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
257
 
>GDestroyNotify</a> destroy_data,
258
 
                                                         ...);</pre>
259
 
<p>
260
 
Store a password associated with a given set of attributes.
261
 
</p>
262
 
<p>
263
 
Attributes which identify this password must be passed as additional 
264
 
arguments. Attributes passed must be defined in the schema.
265
 
</p>
266
 
<p>
267
 
If a password exists in the keyring that already has all the same arguments,
268
 
then the password will be updated. 
269
 
</p>
270
 
<p>
271
 
Another more complex way to create a keyring item is using <a class="link" href="gnome-keyring-gnome-keyring-items.html#gnome-keyring-item-create" title="gnome_keyring_item_create ()"><code class="function">gnome_keyring_item_create()</code></a>.</p>
272
 
<p>
273
 
</p>
274
 
<div class="variablelist"><table border="0">
275
 
<col align="left" valign="top">
276
 
<tbody>
277
 
<tr>
278
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
279
 
<td> The password schema.
280
 
</td>
281
 
</tr>
282
 
<tr>
283
 
<td><p><span class="term"><em class="parameter"><code>keyring</code></em> :</span></p></td>
284
 
<td> The keyring to store the password in. Specify <a
285
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
286
 
><code class="literal">NULL</code></a> for the default keyring. 
287
 
          Use <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-SESSION--CAPS" title="GNOME_KEYRING_SESSION"><code class="literal">GNOME_KEYRING_SESSION</code></a> to store the password in memory only.
288
 
</td>
289
 
</tr>
290
 
<tr>
291
 
<td><p><span class="term"><em class="parameter"><code>display_name</code></em> :</span></p></td>
292
 
<td> A human readable description of what the password is for.
293
 
</td>
294
 
</tr>
295
 
<tr>
296
 
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
297
 
<td> The password to store.
298
 
</td>
299
 
</tr>
300
 
<tr>
301
 
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
302
 
<td> A callback which will be called when the request completes or fails.
303
 
</td>
304
 
</tr>
305
 
<tr>
306
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
307
 
<td> A pointer to arbitrary data that will be passed to the <em class="parameter"><code>callback</code></em>.
308
 
</td>
309
 
</tr>
310
 
<tr>
311
 
<td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
312
 
<td> A function to free <em class="parameter"><code>data</code></em> when it's no longer needed.
313
 
</td>
314
 
</tr>
315
 
<tr>
316
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
317
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
318
 
      terminated string, followed by b) attribute value, either a character string, 
319
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
320
 
      should be terminated with a <a
321
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
322
 
><code class="literal">NULL</code></a>. 
323
 
</td>
324
 
</tr>
325
 
<tr>
326
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
327
 
<td> The asychronous request, which can be passed to <a class="link" href="gnome-keyring-gnome-keyring-misc.html#gnome-keyring-cancel-request" title="gnome_keyring_cancel_request ()"><code class="function">gnome_keyring_cancel_request()</code></a>.
328
 
</td>
329
 
</tr>
330
 
</tbody>
331
 
</table></div>
332
 
<p class="since">Since 2.22</p>
333
 
</div>
334
 
<hr>
335
 
<div class="refsect2" title="gnome_keyring_store_password_sync ()">
336
 
<a name="gnome-keyring-store-password-sync"></a><h3>gnome_keyring_store_password_sync ()</h3>
337
 
<pre class="programlisting"><a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  gnome_keyring_store_password_sync   (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
338
 
                                                         const <a
339
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
340
 
>gchar</a> *keyring,
341
 
                                                         const <a
342
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
343
 
>gchar</a> *display_name,
344
 
                                                         const <a
345
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
346
 
>gchar</a> *password,
347
 
                                                         ...);</pre>
348
 
<p>
349
 
Store a password associated with a given set of attributes.
350
 
</p>
351
 
<p>
352
 
Attributes which identify this password must be passed as additional 
353
 
arguments. Attributes passed must be defined in the schema.
354
 
</p>
355
 
<p>
356
 
This function may block for an unspecified period. If your application must
357
 
remain responsive to the user, then use <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-store-password" title="gnome_keyring_store_password ()"><code class="function">gnome_keyring_store_password()</code></a>. 
358
 
</p>
359
 
<p>
360
 
If a password exists in the keyring that already has all the same arguments,
361
 
then the password will be updated. 
362
 
</p>
363
 
<p>
364
 
Another more complex way to create a keyring item is using 
365
 
<a class="link" href="gnome-keyring-gnome-keyring-items.html#gnome-keyring-item-create-sync" title="gnome_keyring_item_create_sync ()"><code class="function">gnome_keyring_item_create_sync()</code></a>.</p>
366
 
<p>
367
 
</p>
368
 
<div class="variablelist"><table border="0">
369
 
<col align="left" valign="top">
370
 
<tbody>
371
 
<tr>
372
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
373
 
<td> The password schema.
374
 
</td>
375
 
</tr>
376
 
<tr>
377
 
<td><p><span class="term"><em class="parameter"><code>keyring</code></em> :</span></p></td>
378
 
<td> The keyring to store the password in. Specify <a
379
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
380
 
><code class="literal">NULL</code></a> for the default keyring. 
381
 
          Use <a class="link" href="gnome-keyring-gnome-keyring-password.html#GNOME-KEYRING-SESSION--CAPS" title="GNOME_KEYRING_SESSION"><code class="literal">GNOME_KEYRING_SESSION</code></a> to store the password in memory only.
382
 
</td>
383
 
</tr>
384
 
<tr>
385
 
<td><p><span class="term"><em class="parameter"><code>display_name</code></em> :</span></p></td>
386
 
<td> A human readable description of what the password is for.
387
 
</td>
388
 
</tr>
389
 
<tr>
390
 
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
391
 
<td> The password to store.
392
 
</td>
393
 
</tr>
394
 
<tr>
395
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
396
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
397
 
      terminated string, followed by b) attribute value, either a character string, 
398
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
399
 
      should be terminated with a <a
400
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
401
 
><code class="literal">NULL</code></a>. 
402
 
</td>
403
 
</tr>
404
 
<tr>
405
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
406
 
<td> <code class="literal">GNOME_KEYRING_RESULT_OK</code> if the operation was succcessful or 
407
 
an error result otherwise. 
408
 
</td>
409
 
</tr>
410
 
</tbody>
411
 
</table></div>
412
 
<p class="since">Since 2.22</p>
413
 
</div>
414
 
<hr>
415
 
<div class="refsect2" title="gnome_keyring_find_password ()">
416
 
<a name="gnome-keyring-find-password"></a><h3>gnome_keyring_find_password ()</h3>
417
 
<pre class="programlisting"><a
418
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
419
 
>gpointer</a>            gnome_keyring_find_password         (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
420
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationGetStringCallback" title="GnomeKeyringOperationGetStringCallback ()">GnomeKeyringOperationGetStringCallback</a> callback,
421
 
                                                         <a
422
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
423
 
>gpointer</a> data,
424
 
                                                         <a
425
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
426
 
>GDestroyNotify</a> destroy_data,
427
 
                                                         ...);</pre>
428
 
<p>
429
 
Find a password that matches a given set of attributes.
430
 
</p>
431
 
<p>
432
 
Attributes which identify this password must be passed as additional 
433
 
arguments. Attributes passed must be defined in the schema.
434
 
</p>
435
 
<p>
436
 
The string that is passed to <em class="parameter"><code>callback</code></em> is automatically freed when the 
437
 
function returns.
438
 
</p>
439
 
<p>
440
 
Another more complex way to find items in the keyrings is using 
441
 
<a class="link" href="gnome-keyring-gnome-keyring-find.html#gnome-keyring-find-items" title="gnome_keyring_find_items ()"><code class="function">gnome_keyring_find_items()</code></a>.</p>
442
 
<p>
443
 
</p>
444
 
<div class="variablelist"><table border="0">
445
 
<col align="left" valign="top">
446
 
<tbody>
447
 
<tr>
448
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
449
 
<td> The password schema.
450
 
</td>
451
 
</tr>
452
 
<tr>
453
 
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
454
 
<td> A callback which will be called when the request completes or fails.
455
 
</td>
456
 
</tr>
457
 
<tr>
458
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
459
 
<td> A pointer to arbitrary data that will be passed to the <em class="parameter"><code>callback</code></em>.
460
 
</td>
461
 
</tr>
462
 
<tr>
463
 
<td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
464
 
<td> A function to free <em class="parameter"><code>data</code></em> when it's no longer needed.
465
 
</td>
466
 
</tr>
467
 
<tr>
468
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
469
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
470
 
      terminated string, followed by b) attribute value, either a character string, 
471
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
472
 
      should be terminated with a <a
473
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
474
 
><code class="literal">NULL</code></a>. 
475
 
</td>
476
 
</tr>
477
 
<tr>
478
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
479
 
<td> The asychronous request, which can be passed to <a class="link" href="gnome-keyring-gnome-keyring-misc.html#gnome-keyring-cancel-request" title="gnome_keyring_cancel_request ()"><code class="function">gnome_keyring_cancel_request()</code></a>.
480
 
</td>
481
 
</tr>
482
 
</tbody>
483
 
</table></div>
484
 
<p class="since">Since 2.22</p>
485
 
</div>
486
 
<hr>
487
 
<div class="refsect2" title="gnome_keyring_find_password_sync ()">
488
 
<a name="gnome-keyring-find-password-sync"></a><h3>gnome_keyring_find_password_sync ()</h3>
489
 
<pre class="programlisting"><a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  gnome_keyring_find_password_sync    (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
490
 
                                                         <a
491
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
492
 
>gchar</a> **password,
493
 
                                                         ...);</pre>
494
 
<p>
495
 
Find a password that matches a given set of attributes.
496
 
</p>
497
 
<p>
498
 
Attributes which identify this password must be passed as additional 
499
 
arguments. Attributes passed must be defined in the schema.
500
 
</p>
501
 
<p>
502
 
This function may block for an unspecified period. If your application must
503
 
remain responsive to the user, then use <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-find-password" title="gnome_keyring_find_password ()"><code class="function">gnome_keyring_find_password()</code></a>. 
504
 
</p>
505
 
<p>
506
 
Another more complex way to find items in the keyrings is using 
507
 
<a class="link" href="gnome-keyring-gnome-keyring-find.html#gnome-keyring-find-items-sync" title="gnome_keyring_find_items_sync ()"><code class="function">gnome_keyring_find_items_sync()</code></a>.</p>
508
 
<p>
509
 
</p>
510
 
<div class="variablelist"><table border="0">
511
 
<col align="left" valign="top">
512
 
<tbody>
513
 
<tr>
514
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
515
 
<td> The password schema.
516
 
</td>
517
 
</tr>
518
 
<tr>
519
 
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
520
 
<td> An address to store password that was found. The password must 
521
 
           be freed with <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-free-password" title="gnome_keyring_free_password ()"><code class="function">gnome_keyring_free_password()</code></a>.
522
 
</td>
523
 
</tr>
524
 
<tr>
525
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
526
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
527
 
      terminated string, followed by b) attribute value, either a character string, 
528
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
529
 
      should be terminated with a <a
530
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
531
 
><code class="literal">NULL</code></a>. 
532
 
</td>
533
 
</tr>
534
 
<tr>
535
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
536
 
<td> <code class="literal">GNOME_KEYRING_RESULT_OK</code> if the operation was succcessful or 
537
 
an error result otherwise. 
538
 
</td>
539
 
</tr>
540
 
</tbody>
541
 
</table></div>
542
 
<p class="since">Since 2.22</p>
543
 
</div>
544
 
<hr>
545
 
<div class="refsect2" title="gnome_keyring_delete_password ()">
546
 
<a name="gnome-keyring-delete-password"></a><h3>gnome_keyring_delete_password ()</h3>
547
 
<pre class="programlisting"><a
548
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
549
 
>gpointer</a>            gnome_keyring_delete_password       (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
550
 
                                                         <a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationDoneCallback" title="GnomeKeyringOperationDoneCallback ()">GnomeKeyringOperationDoneCallback</a> callback,
551
 
                                                         <a
552
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
553
 
>gpointer</a> data,
554
 
                                                         <a
555
 
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
556
 
>GDestroyNotify</a> destroy_data,
557
 
                                                         ...);</pre>
558
 
<p>
559
 
Delete a password that matches a given set of attributes.
560
 
</p>
561
 
<p>
562
 
Attributes which identify this password must be passed as additional 
563
 
arguments. Attributes passed must be defined in the schema.
564
 
</p>
565
 
<p>
566
 
Another more complex way to find items in the keyrings is using 
567
 
<a class="link" href="gnome-keyring-gnome-keyring-items.html#gnome-keyring-item-delete" title="gnome_keyring_item_delete ()"><code class="function">gnome_keyring_item_delete()</code></a>.</p>
568
 
<p>
569
 
</p>
570
 
<div class="variablelist"><table border="0">
571
 
<col align="left" valign="top">
572
 
<tbody>
573
 
<tr>
574
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
575
 
<td> The password schema.
576
 
</td>
577
 
</tr>
578
 
<tr>
579
 
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
580
 
<td> A callback which will be called when the request completes or fails.
581
 
</td>
582
 
</tr>
583
 
<tr>
584
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
585
 
<td> A pointer to arbitrary data that will be passed to the <em class="parameter"><code>callback</code></em>.
586
 
</td>
587
 
</tr>
588
 
<tr>
589
 
<td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
590
 
<td> A function to free <em class="parameter"><code>data</code></em> when it's no longer needed.
591
 
</td>
592
 
</tr>
593
 
<tr>
594
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
595
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
596
 
      terminated string, followed by b) attribute value, either a character string, 
597
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
598
 
      should be terminated with a <a
599
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
600
 
><code class="literal">NULL</code></a>. 
601
 
</td>
602
 
</tr>
603
 
<tr>
604
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
605
 
<td> The asychronous request, which can be passed to <a class="link" href="gnome-keyring-gnome-keyring-misc.html#gnome-keyring-cancel-request" title="gnome_keyring_cancel_request ()"><code class="function">gnome_keyring_cancel_request()</code></a>.
606
 
</td>
607
 
</tr>
608
 
</tbody>
609
 
</table></div>
610
 
<p class="since">Since 2.22</p>
611
 
</div>
612
 
<hr>
613
 
<div class="refsect2" title="gnome_keyring_delete_password_sync ()">
614
 
<a name="gnome-keyring-delete-password-sync"></a><h3>gnome_keyring_delete_password_sync ()</h3>
615
 
<pre class="programlisting"><a class="link" href="gnome-keyring-gnome-keyring-result.html#GnomeKeyringResult" title="enum GnomeKeyringResult">GnomeKeyringResult</a>  gnome_keyring_delete_password_sync  (const <a class="link" href="gnome-keyring-gnome-keyring-password.html#GnomeKeyringPasswordSchema" title="GnomeKeyringPasswordSchema">GnomeKeyringPasswordSchema</a> *schema,
616
 
                                                         ...);</pre>
617
 
<p>
618
 
Delete a password that matches a given set of attributes.
619
 
</p>
620
 
<p>
621
 
Attributes which identify this password must be passed as additional 
622
 
arguments. Attributes passed must be defined in the schema.
623
 
</p>
624
 
<p>
625
 
This function may block for an unspecified period. If your application must
626
 
remain responsive to the user, then use <a class="link" href="gnome-keyring-gnome-keyring-password.html#gnome-keyring-delete-password" title="gnome_keyring_delete_password ()"><code class="function">gnome_keyring_delete_password()</code></a>. 
627
 
</p>
628
 
<p>
629
 
Another more complex way to find items in the keyrings is using 
630
 
<a class="link" href="gnome-keyring-gnome-keyring-items.html#gnome-keyring-item-delete-sync" title="gnome_keyring_item_delete_sync ()"><code class="function">gnome_keyring_item_delete_sync()</code></a>.</p>
631
 
<p>
632
 
</p>
633
 
<div class="variablelist"><table border="0">
634
 
<col align="left" valign="top">
635
 
<tbody>
636
 
<tr>
637
 
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
638
 
<td> The password schema.
639
 
</td>
640
 
</tr>
641
 
<tr>
642
 
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
643
 
<td> The variable argument list should contain pairs of a) The attribute name as a null 
644
 
      terminated string, followed by b) attribute value, either a character string, 
645
 
      or 32-bit unsigned int, as defined in the password <em class="parameter"><code>schema</code></em>. The list of attribtues
646
 
      should be terminated with a <a
647
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
648
 
><code class="literal">NULL</code></a>. 
649
 
</td>
650
 
</tr>
651
 
<tr>
652
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
653
 
<td> <code class="literal">GNOME_KEYRING_RESULT_OK</code> if the operation was succcessful or 
654
 
an error result otherwise. 
655
 
</td>
656
 
</tr>
657
 
</tbody>
658
 
</table></div>
659
 
<p class="since">Since 2.22</p>
660
 
</div>
661
 
<hr>
662
 
<div class="refsect2" title="gnome_keyring_free_password ()">
663
 
<a name="gnome-keyring-free-password"></a><h3>gnome_keyring_free_password ()</h3>
664
 
<pre class="programlisting">void                gnome_keyring_free_password         (<a
665
 
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
666
 
>gchar</a> *password);</pre>
667
 
<p>
668
 
Clears the memory used by password by filling with '\0' and frees the memory
669
 
after doing this. You should use this function instead of <a
670
 
href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"
671
 
><code class="function">g_free()</code></a> for
672
 
secret information.</p>
673
 
<p>
674
 
</p>
675
 
<div class="variablelist"><table border="0">
676
 
<col align="left" valign="top">
677
 
<tbody><tr>
678
 
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
679
 
<td> the password to be freed
680
 
</td>
681
 
</tr></tbody>
682
 
</table></div>
683
 
</div>
684
 
</div>
685
 
</div>
686
 
<div class="footer">
687
 
<hr>
688
 
          Generated by GTK-Doc V1.11</div>
689
 
</body>
690
 
</html>