1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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">
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">
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>
24
<tr><td colspan="5" class="shortcuts">
25
<a href="#gnome-keyring-gnome-keyring-password.synopsis" class="shortcut">Top</a>
27
<a href="#gnome-keyring-gnome-keyring-password.description" class="shortcut">Description</a>
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>
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>
37
<td valign="top" align="right"></td>
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>
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,
50
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
53
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
54
>gchar</a> *display_name,
56
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
58
<a class="link" href="gnome-keyring-gnome-keyring-generic-callbacks.html#GnomeKeyringOperationDoneCallback" title="GnomeKeyringOperationDoneCallback ()">GnomeKeyringOperationDoneCallback</a> callback,
60
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
63
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
64
>GDestroyNotify</a> destroy_data,
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,
68
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
71
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
72
>gchar</a> *display_name,
74
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
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,
82
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
85
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
86
>GDestroyNotify</a> destroy_data,
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,
90
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
91
>gchar</a> **password,
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,
98
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
101
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
102
>GDestroyNotify</a> destroy_data,
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,
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);
111
<div class="refsect1" title="Description">
112
<a name="gnome-keyring-gnome-keyring-password.description"></a><h2>Description</h2>
114
This is a simple API for storing passwords and retrieving passwords in the keyring.
117
Each password is associated with a set of attributes. Attribute values can be either
118
strings or unsigned integers.
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.
125
Each function accepts a variable list of attributes names and their values.
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.
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
142
<p><br class="example-break"></p>
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;
154
GnomeKeyringAttributeType type;
156
} GnomeKeyringPasswordSchema;
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>.
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>.
173
<pre class="programlisting">
174
GnomeKeyringPasswordSchema my_schema = {
175
GNOME_KEYRING_ITEM_GENERIC_SECRET,
177
{ "string-attr", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
178
{ "uint-attr", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
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;
196
A predefined schema for network paswsords. It contains the following attributes:
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>
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
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"
231
A keyring only stored in memory.
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,
243
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
246
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
247
>gchar</a> *display_name,
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,
253
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
256
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
257
>GDestroyNotify</a> destroy_data,
260
Store a password associated with a given set of attributes.
263
Attributes which identify this password must be passed as additional
264
arguments. Attributes passed must be defined in the schema.
267
If a password exists in the keyring that already has all the same arguments,
268
then the password will be updated.
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>
274
<div class="variablelist"><table border="0">
275
<col align="left" valign="top">
278
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
279
<td> The password schema.
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.
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.
296
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
297
<td> The password to store.
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.
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>.
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.
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>.
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>.
332
<p class="since">Since 2.22</p>
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,
339
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
342
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
343
>gchar</a> *display_name,
345
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
346
>gchar</a> *password,
349
Store a password associated with a given set of attributes.
352
Attributes which identify this password must be passed as additional
353
arguments. Attributes passed must be defined in the schema.
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>.
360
If a password exists in the keyring that already has all the same arguments,
361
then the password will be updated.
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>
368
<div class="variablelist"><table border="0">
369
<col align="left" valign="top">
372
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
373
<td> The password schema.
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.
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.
390
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
391
<td> The password to store.
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>.
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.
412
<p class="since">Since 2.22</p>
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,
422
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
425
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
426
>GDestroyNotify</a> destroy_data,
429
Find a password that matches a given set of attributes.
432
Attributes which identify this password must be passed as additional
433
arguments. Attributes passed must be defined in the schema.
436
The string that is passed to <em class="parameter"><code>callback</code></em> is automatically freed when the
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>
444
<div class="variablelist"><table border="0">
445
<col align="left" valign="top">
448
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
449
<td> The password schema.
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.
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>.
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.
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>.
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>.
484
<p class="since">Since 2.22</p>
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,
491
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
492
>gchar</a> **password,
495
Find a password that matches a given set of attributes.
498
Attributes which identify this password must be passed as additional
499
arguments. Attributes passed must be defined in the schema.
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>.
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>
510
<div class="variablelist"><table border="0">
511
<col align="left" valign="top">
514
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
515
<td> The password schema.
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>.
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>.
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.
542
<p class="since">Since 2.22</p>
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,
552
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
555
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
556
>GDestroyNotify</a> destroy_data,
559
Delete a password that matches a given set of attributes.
562
Attributes which identify this password must be passed as additional
563
arguments. Attributes passed must be defined in the schema.
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>
570
<div class="variablelist"><table border="0">
571
<col align="left" valign="top">
574
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
575
<td> The password schema.
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.
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>.
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.
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>.
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>.
610
<p class="since">Since 2.22</p>
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,
618
Delete a password that matches a given set of attributes.
621
Attributes which identify this password must be passed as additional
622
arguments. Attributes passed must be defined in the schema.
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>.
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>
633
<div class="variablelist"><table border="0">
634
<col align="left" valign="top">
637
<td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
638
<td> The password schema.
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>.
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.
659
<p class="since">Since 2.22</p>
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>
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>
675
<div class="variablelist"><table border="0">
676
<col align="left" valign="top">
678
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
679
<td> the password to be freed
688
Generated by GTK-Doc V1.11</div>