This file is indexed.

/usr/share/gtk-doc/html/p11-kit/p11-kit-Modules.html is in libp11-kit-dev 0.12-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
386
387
388
389
390
391
392
393
394
395
396
397
398
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Modules</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="reference.html" title="Reference">
<link rel="prev" href="reference.html" title="Reference">
<link rel="next" href="p11-kit-URIs.html" title="URIs">
<meta name="generator" content="GTK-Doc V1.18 (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="reference.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.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">p11-kit</th>
<td><a accesskey="n" href="p11-kit-URIs.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#p11-kit-Modules.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#p11-kit-Modules.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="p11-kit-Modules"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="p11-kit-Modules.top_of_page"></a>Modules</span></h2>
<p>Modules — Module loading and initializing</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="p11-kit-Modules.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()">p11_kit_initialize_registered</a>       (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()">p11_kit_finalize_registered</a>         (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span></a> * <a class="link" href="p11-kit-Modules.html#p11-kit-registered-modules" title="p11_kit_registered_modules ()">p11_kit_registered_modules</a>       (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">char</span> *              <a class="link" href="p11-kit-Modules.html#p11-kit-registered-module-to-name" title="p11_kit_registered_module_to_name ()">p11_kit_registered_module_to_name</a>   (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span></a> <a class="link" href="p11-kit-Modules.html#p11-kit-registered-name-to-module" title="p11_kit_registered_name_to_module ()">p11_kit_registered_name_to_module</a>  (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
<span class="returnvalue">char</span> *              <a class="link" href="p11-kit-Modules.html#p11-kit-registered-option" title="p11_kit_registered_option ()">p11_kit_registered_option</a>           (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *field</code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()">p11_kit_initialize_module</a>           (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               <a class="link" href="p11-kit-Modules.html#p11-kit-load-initialize-module" title="p11_kit_load_initialize_module ()">p11_kit_load_initialize_module</a>      (<em class="parameter"><code>const <span class="type">char</span> *module_path</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> *module</code></em>);
<a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()">p11_kit_finalize_module</a>             (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="p11-kit-Modules.description"></a><h2>Description</h2>
<p>
PKCS#11 modules are used by crypto libraries and applications to access
crypto objects (like keys and certificates) and to perform crypto operations.
</p>
<p>
In order for applications to behave consistently with regard to the user's
installed PKCS#11 modules, each module must be registered so that applications
or libraries know that they should load it.
</p>
<p>
The functions here provide support for initializing registered modules. The
<a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a> function should be used to load and initialize
the registered modules. When done, the <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()"><code class="function">p11_kit_finalize_registered()</code></a> function
should be used to release those modules and associated resources.
</p>
<p>
In addition <a class="link" href="p11-kit-Modules.html#p11-kit-registered-option" title="p11_kit_registered_option ()"><code class="function">p11_kit_registered_option()</code></a> can be used to access other parts
of the module configuration.
</p>
<p>
When multiple consumers of a module (such as libraries or applications) are
in the same process, coordination of the initialization and finalization
of PKCS#11 modules is required. The functions here automatically provide
initialization reference counting to make this work.
</p>
<p>
If a consumer wishes to load an arbitrary PKCS#11 module that's not
registered, that module should be initialized with <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()"><code class="function">p11_kit_initialize_module()</code></a>
and finalized with <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()"><code class="function">p11_kit_finalize_module()</code></a>. The module's own
<code class="code">C_Initialize</code> and <code class="code">C_Finalize</code> methods should not
be called directly.
</p>
<p>
Modules are represented by a pointer to their <code class="code">CK_FUNCTION_LIST</code>
entry points. This means that callers can load modules elsewhere, using
<code class="function">dlopen()</code> for example, and then still use these methods on them.
</p>
</div>
<div class="refsect1">
<a name="p11-kit-Modules.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="p11-kit-initialize-registered"></a><h3>p11_kit_initialize_registered ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               p11_kit_initialize_registered       (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Initialize all the registered PKCS#11 modules.
</p>
<p>
If this is the first time this function is called multiple times
consecutively within a single process, then it merely increments an
initialization reference count for each of these modules.
</p>
<p>
Use <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()"><code class="function">p11_kit_finalize_registered()</code></a> to finalize these registered modules once
the caller is done with them.
</p>
<p>
If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Future.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CKR_OK if the initialization succeeded, or an error code.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-finalize-registered"></a><h3>p11_kit_finalize_registered ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               p11_kit_finalize_registered         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Finalize all the registered PKCS#11 modules. These should have been
initialized with <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a>.
</p>
<p>
If <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a> has been called more than once in this
process, then this function must be called the same number of times before
actual finalization will occur.
</p>
<p>
If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Future.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CKR_OK if the finalization succeeded, or an error code.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-registered-modules"></a><h3>p11_kit_registered_modules ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span></a> * p11_kit_registered_modules       (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Get a list of all the registered PKCS#11 modules. This list will be valid
once the <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a> function has been called.
</p>
<p>
The returned value is a <code class="code">NULL</code> terminated array of
<code class="code">CK_FUNCTION_LIST_PTR</code> pointers.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A list of all the registered modules. Use the <code class="function">free()</code> function to
free the list.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-registered-module-to-name"></a><h3>p11_kit_registered_module_to_name ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              p11_kit_registered_module_to_name   (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);</pre>
<p>
Get the name of a registered PKCS#11 module.
</p>
<p>
You can use <a class="link" href="p11-kit-Modules.html#p11-kit-registered-modules" title="p11_kit_registered_modules ()"><code class="function">p11_kit_registered_modules()</code></a> to get a list of all the registered
modules. This name is specified by the registered module configuration.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
<td>pointer to a registered module</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated string containing the module name, or
<code class="code">NULL</code> if no such registered module exists. Use <code class="function">free()</code> to
free this string.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-registered-name-to-module"></a><h3>p11_kit_registered_name_to_module ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span></a> p11_kit_registered_name_to_module  (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>
Lookup a registered PKCS#11 module by its name. This name is specified by
the registered module configuration.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>name of a registered module</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to a PKCS#11 module, or <code class="code">NULL</code> if this name was
not found.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-registered-option"></a><h3>p11_kit_registered_option ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              p11_kit_registered_option           (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *field</code></em>);</pre>
<p>
Lookup a configured option for a registered PKCS#11 module. If a
<code class="code">NULL</code> module argument is specified, then this will lookup
the configuration option in the global config file.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
<td>a pointer to a registered module</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>field</code></em> :</span></p></td>
<td>the name of the option to lookup.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated string containing the option value, or
<code class="code">NULL</code> if the registered module or the option were not found.
Use <code class="function">free()</code> to free the returned string.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-initialize-module"></a><h3>p11_kit_initialize_module ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               p11_kit_initialize_module           (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);</pre>
<p>
Initialize an arbitrary PKCS#11 module. Normally using the
<a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a> is preferred.
</p>
<p>
Using this function to initialize modules allows coordination between
multiple users of the same module in a single process. It should be called
on modules that have been loaded (with <code class="function">dlopen()</code> for example) but not yet
initialized. The caller should not yet have called the module's
<code class="code">C_Initialize</code> method. This function will call
<code class="code">C_Initialize</code> as necessary.
</p>
<p>
Subsequent calls to this function for the same module will result in an
initialization count being incremented for the module. It is safe (although
usually unnecessary) to use this function on registered modules.
</p>
<p>
The module must be finalized with <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()"><code class="function">p11_kit_finalize_module()</code></a> instead of
calling its <code class="code">C_Finalize</code> method directly.
</p>
<p>
This function does not accept a <code class="code">CK_C_INITIALIZE_ARGS</code> argument.
Custom initialization arguments cannot be supported when multiple consumers
load the same module.
</p>
<p>
If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Future.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
<td>loaded module to initialize.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CKR_OK if the initialization was successful.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-load-initialize-module"></a><h3>p11_kit_load_initialize_module ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               p11_kit_load_initialize_module      (<em class="parameter"><code>const <span class="type">char</span> *module_path</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> *module</code></em>);</pre>
<p>
Load an arbitrary PKCS#11 module from a dynamic library file, and
initialize it. Normally using the <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()"><code class="function">p11_kit_initialize_registered()</code></a> function
is preferred.
</p>
<p>
Using this function to load and initialize modules allows coordination between
multiple users of the same module in a single process. The caller should not
call the module's <code class="code">C_Initialize</code> method. This function will call
<code class="code">C_Initialize</code> as necessary.
</p>
<p>
If a module has already been loaded, then use of this function is unnecesasry.
Instead use the <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()"><code class="function">p11_kit_initialize_module()</code></a> function to initialize it.
</p>
<p>
Subsequent calls to this function for the same module will result in an
initialization count being incremented for the module. It is safe (although
usually unnecessary) to use this function on registered modules.
</p>
<p>
The module must be finalized with <a class="link" href="p11-kit-Modules.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()"><code class="function">p11_kit_finalize_module()</code></a> instead of
calling its <code class="code">C_Finalize</code> method directly.
</p>
<p>
This function does not accept a <code class="code">CK_C_INITIALIZE_ARGS</code> argument.
Custom initialization arguments cannot be supported when multiple consumers
load the same module.
</p>
<p>
If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Future.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>module_path</code></em> :</span></p></td>
<td>full file path of module library</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
<td>location to place loaded module pointer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CKR_OK if the initialization was successful.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-finalize-module"></a><h3>p11_kit_finalize_module ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-RV:CAPS"><span class="returnvalue">CK_RV</span></a>               p11_kit_finalize_module             (<em class="parameter"><code><a href="http://developer.gnome.org/gck/stable/pkcs11-links.html#CK-FUNCTION-LIST-PTR:CAPS"><span class="type">CK_FUNCTION_LIST_PTR</span></a> module</code></em>);</pre>
<p>
Finalize an arbitrary PKCS#11 module. The module must have been initialized
using <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()"><code class="function">p11_kit_initialize_module()</code></a>. In most cases callers will want to use
<a class="link" href="p11-kit-Modules.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()"><code class="function">p11_kit_finalize_registered()</code></a> instead of this function.
</p>
<p>
Using this function to finalize modules allows coordination between
multiple users of the same module in a single process. The caller should
call the module's <code class="code">C_Finalize</code> method. This function will call
<code class="code">C_Finalize</code> as necessary.
</p>
<p>
If the module was initialized more than once, then this function will
decrement an initialization count for the module. When the count reaches zero
the module will be truly finalized. It is safe (although usually unnecessary)
to use this function on registered modules if (and only if) they were
initialized using <a class="link" href="p11-kit-Modules.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()"><code class="function">p11_kit_initialize_module()</code></a> for some reason.
</p>
<p>
If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Future.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>module</code></em> :</span></p></td>
<td>loaded module to finalize.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CKR_OK if the finalization was successful.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>