summaryrefstree
path: root/usr/share/gtk-doc/html/gio/GTlsInteraction.html
blob: 82916bea80a274090255b922847261a2494c47af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GTlsInteraction</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="tls.html" title="TLS (SSL) support">
<link rel="prev" href="GTlsFileDatabase.html" title="GTlsFileDatabase">
<link rel="next" href="GTlsPassword.html" title="GTlsPassword">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GTlsFileDatabase.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="tls.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GTlsPassword.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GTlsInteraction.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GTlsInteraction.description" class="shortcut">Description</a>
                   | 
                  <a href="#GTlsInteraction.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="GTlsInteraction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GTlsInteraction.top_of_page"></a>GTlsInteraction</span></h2>
<p>GTlsInteraction — Interaction with the user during TLS operations.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GTlsInteraction.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="GTlsInteraction.html#GTlsInteraction-struct" title="GTlsInteraction">GTlsInteraction</a>;
enum                <a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult">GTlsInteractionResult</a>;
<a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> <a class="link" href="GTlsInteraction.html#g-tls-interaction-ask-password" title="g_tls_interaction_ask_password ()">g_tls_interaction_ask_password</a>    (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GTlsInteraction.html#g-tls-interaction-ask-password-async" title="g_tls_interaction_ask_password_async ()">g_tls_interaction_ask_password_async</a>
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> <a class="link" href="GTlsInteraction.html#g-tls-interaction-ask-password-finish" title="g_tls_interaction_ask_password_finish ()">g_tls_interaction_ask_password_finish</a>
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> <a class="link" href="GTlsInteraction.html#g-tls-interaction-invoke-ask-password" title="g_tls_interaction_invoke_ask_password ()">g_tls_interaction_invoke_ask_password</a>
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GTlsInteraction.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----GTlsInteraction
</pre>
</div>
<div class="refsect1">
<a name="GTlsInteraction.description"></a><h2>Description</h2>
<p>
<a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> provides a mechanism for the TLS connection and database
code to interact with the user. It can be used to ask the user for passwords.
</p>
<p>
To use a <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> with a TLS connection use
<a class="link" href="GTlsConnection.html#g-tls-connection-set-interaction" title="g_tls_connection_set_interaction ()"><code class="function">g_tls_connection_set_interaction()</code></a>.
</p>
<p>
Callers should instantiate a derived class that implements the various
interaction methods to show the required dialogs.
</p>
<p>
Callers should use the 'invoke' functions like
<a class="link" href="GTlsInteraction.html#g-tls-interaction-invoke-ask-password" title="g_tls_interaction_invoke_ask_password ()"><code class="function">g_tls_interaction_invoke_ask_password()</code></a> to run interaction methods. These
functions make sure that the interaction is invoked in the main loop
and not in the current thread, if the current thread is not running the
main loop.
</p>
<p>
Derived classes can choose to implement whichever interactions methods they'd
like to support by overriding those virtual methods in their class
initialization function. Any interactions not implemented will return
<a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-UNHANDLED:CAPS"><code class="literal">G_TLS_INTERACTION_UNHANDLED</code></a>. If a derived class implements an async method,
it must also implement the corresponding finish method.
</p>
</div>
<div class="refsect1">
<a name="GTlsInteraction.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GTlsInteraction-struct"></a><h3>GTlsInteraction</h3>
<pre class="programlisting">typedef struct _GTlsInteraction GTlsInteraction;</pre>
<p>
An object representing interaction that the TLS connection and database
might have with the user.
</p>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="GTlsInteractionResult"></a><h3>enum GTlsInteractionResult</h3>
<pre class="programlisting">typedef enum {
  G_TLS_INTERACTION_UNHANDLED,
  G_TLS_INTERACTION_HANDLED,
  G_TLS_INTERACTION_FAILED
} GTlsInteractionResult;
</pre>
<p>
<a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="type">GTlsInteractionResult</span></a> is returned by various functions in <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a>
when finishing an interaction request.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="G-TLS-INTERACTION-UNHANDLED:CAPS"></a><span class="term"><code class="literal">G_TLS_INTERACTION_UNHANDLED</code></span></p></td>
<td>The interaction was unhandled (i.e. not
    implemented).
</td>
</tr>
<tr>
<td><p><a name="G-TLS-INTERACTION-HANDLED:CAPS"></a><span class="term"><code class="literal">G_TLS_INTERACTION_HANDLED</code></span></p></td>
<td>The interaction completed, and resulting data
    is available.
</td>
</tr>
<tr>
<td><p><a name="G-TLS-INTERACTION-FAILED:CAPS"></a><span class="term"><code class="literal">G_TLS_INTERACTION_FAILED</code></span></p></td>
<td>The interaction has failed, or was cancelled.
    and the operation should be aborted.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="g-tls-interaction-ask-password"></a><h3>g_tls_interaction_ask_password ()</h3>
<pre class="programlisting"><a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> g_tls_interaction_ask_password    (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Run synchronous interaction to ask the user for a password. In general,
<a class="link" href="GTlsInteraction.html#g-tls-interaction-invoke-ask-password" title="g_tls_interaction_invoke_ask_password ()"><code class="function">g_tls_interaction_invoke_ask_password()</code></a> should be used instead of this
function.
</p>
<p>
Derived subclasses usually implement a password prompt, although they may
also choose to provide a password from elsewhere. The <em class="parameter"><code>password</code></em> value will
be filled in and then <em class="parameter"><code>callback</code></em> will be called. Alternatively the user may
abort this password request, which will usually abort the TLS connection.
</p>
<p>
If the interaction is cancelled by the cancellation object, or by the
user then <a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-FAILED:CAPS"><code class="literal">G_TLS_INTERACTION_FAILED</code></a> will be returned with an error that
contains a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> error code. Certain implementations may
not support immediate cancellation.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interaction</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>an optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> cancellation object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>an optional location to place an error on failure</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The status of the ask password interaction.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="g-tls-interaction-ask-password-async"></a><h3>g_tls_interaction_ask_password_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_tls_interaction_ask_password_async
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Run asynchronous interaction to ask the user for a password. In general,
<a class="link" href="GTlsInteraction.html#g-tls-interaction-invoke-ask-password" title="g_tls_interaction_invoke_ask_password ()"><code class="function">g_tls_interaction_invoke_ask_password()</code></a> should be used instead of this
function.
</p>
<p>
Derived subclasses usually implement a password prompt, although they may
also choose to provide a password from elsewhere. The <em class="parameter"><code>password</code></em> value will
be filled in and then <em class="parameter"><code>callback</code></em> will be called. Alternatively the user may
abort this password request, which will usually abort the TLS connection.
</p>
<p>
If the interaction is cancelled by the cancellation object, or by the
user then <a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-FAILED:CAPS"><code class="literal">G_TLS_INTERACTION_FAILED</code></a> will be returned with an error that
contains a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> error code. Certain implementations may
not support immediate cancellation.
</p>
<p>
Certain implementations may not support immediate cancellation.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interaction</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>an optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> cancellation object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>will be called when the interaction completes. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>data to pass to the <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="g-tls-interaction-ask-password-finish"></a><h3>g_tls_interaction_ask_password_finish ()</h3>
<pre class="programlisting"><a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> g_tls_interaction_ask_password_finish
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Complete an ask password user interaction request. This should be once
the <a class="link" href="GTlsInteraction.html#g-tls-interaction-ask-password-async" title="g_tls_interaction_ask_password_async ()"><code class="function">g_tls_interaction_ask_password_async()</code></a> completion callback is called.
</p>
<p>
If <a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-HANDLED:CAPS"><code class="literal">G_TLS_INTERACTION_HANDLED</code></a> is returned, then the <a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> passed
to <a class="link" href="GTlsInteraction.html#g-tls-interaction-ask-password" title="g_tls_interaction_ask_password ()"><code class="function">g_tls_interaction_ask_password()</code></a> will have its password filled in.
</p>
<p>
If the interaction is cancelled by the cancellation object, or by the
user then <a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-FAILED:CAPS"><code class="literal">G_TLS_INTERACTION_FAILED</code></a> will be returned with an error that
contains a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> error code.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interaction</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>the result passed to the callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>an optional location to place an error on failure</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The status of the ask password interaction.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
<hr>
<div class="refsect2">
<a name="g-tls-interaction-invoke-ask-password"></a><h3>g_tls_interaction_invoke_ask_password ()</h3>
<pre class="programlisting"><a class="link" href="GTlsInteraction.html#GTlsInteractionResult" title="enum GTlsInteractionResult"><span class="returnvalue">GTlsInteractionResult</span></a> g_tls_interaction_invoke_ask_password
                                                        (<em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> *password</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Invoke the interaction to ask the user for a password. It invokes this
interaction in the main loop, specifically the <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> returned by
<a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-main-context-get-thread-default"><code class="function">g_main_context_get_thread_default()</code></a> when the interaction is created. This
is called by called by <a class="link" href="GTlsConnection.html" title="GTlsConnection"><span class="type">GTlsConnection</span></a> or <a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="type">GTlsDatabase</span></a> to ask the user
for a password.
</p>
<p>
Derived subclasses usually implement a password prompt, although they may
also choose to provide a password from elsewhere. The <em class="parameter"><code>password</code></em> value will
be filled in and then <em class="parameter"><code>callback</code></em> will be called. Alternatively the user may
abort this password request, which will usually abort the TLS connection.
</p>
<p>
The implementation can either be a synchronous (eg: modal dialog) or an
asynchronous one (eg: modeless dialog). This function will take care of
calling which ever one correctly.
</p>
<p>
If the interaction is cancelled by the cancellation object, or by the
user then <a class="link" href="GTlsInteraction.html#G-TLS-INTERACTION-FAILED:CAPS"><code class="literal">G_TLS_INTERACTION_FAILED</code></a> will be returned with an error that
contains a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> error code. Certain implementations may
not support immediate cancellation.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interaction</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>a <a class="link" href="GTlsPassword.html" title="GTlsPassword"><span class="type">GTlsPassword</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>an optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> cancellation object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>an optional location to place an error on failure</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The status of the ask password interaction.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.30</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.19</div>
</body>
</html>