made the pack completely portable and wrote relevent bat files to go with it

This commit is contained in:
Draqoken
2025-04-09 17:04:56 +03:00
parent 5e77d7e9cf
commit 5e4144c3c0
7417 changed files with 2181044 additions and 19 deletions

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Example: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="config.html" title="PKCS#11 Configuration">
<link rel="prev" href="config.html" title="PKCS#11 Configuration">
<link rel="next" href="config-files.html" title="Configuration Files">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="config.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="config.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="config-files.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="config-example"></a>Example</h2></div></div></div>
<p>The following sections describe the config format in detail. But first
an example which shows the various features. The configuration below, loads
two modules called 'my-module' and 'nss'. The user settings override some
aspects of the system settings.</p>
<p>Global configuration file: <code class="literal">/etc/pkcs11/pkcs11.conf</code></p>
<pre class="programlisting">
# This setting controls whether to load user configuration from the
# ~/.config/pkcs11 directory. Possible values:
# none: No user configuration
# merge: Merge the user config over the system configuration (default)
# only: Only user configuration, ignore system configuration
user-config: merge
</pre>
<p>One module configuration file per module: <code class="literal">/etc/pkcs11/modules/my-module</code></p>
<pre class="programlisting">
# This setting controls the actual module library to load. This config file
# might be installed by the package that installs this module library. This
# is not an absolute path name. Relative path names are loaded from the
# $(libdir)/pkcs11 directory by default.
module: my-pkcs11-module.so
# This controls whether the module is required to successfully initialize. If 'yes', then
# a failure to load or initialize this module will result in a p11-kit system failure.
critical: no
</pre>
<p>User configuration file: <code class="literal">~/.config/pkcs11/pkcs11.conf</code></p>
<pre class="programlisting">
# This is an empty file. Files that do not exist are treated as empty.
</pre>
<p>User configuration file: <code class="literal">~/.config/pkcs11/modules/my-module</code></p>
<pre class="programlisting">
# Merge with the settings in the system my-module config file. In this case
# a developer has overridden to load a different module for my-module instead.
module: /home/user/src/custom-module/my-module.so
</pre>
<p>User configuration file: <code class="literal">~/.config/pkcs11/modules/nss</code></p>
<pre class="programlisting">
# Load the NSS libsoftokn.so.3 PKCS#11 library as a module. Note that we pass
# some custom non-standard initialization arguments, as NSS expects.
module: /usr/lib/libsoftokn3.so
x-init-reserved: configdir='sql:/home/test/.pki/nssdb' certPrefix='' keyPrefix='' secmod='socmod.db'
critical: yes
</pre>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Configuration Files: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="config.html" title="PKCS#11 Configuration">
<link rel="prev" href="config-example.html" title="Example">
<link rel="next" href="sharing.html" title="Sharing PKCS#11 modules">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="config.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="config-example.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="sharing.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="config-files"></a>Configuration Files</h2></div></div></div>
<p>A complete configuration consists of several files. These files are
text files. Since <code class="literal">p11-kit</code> is built to be used in all
sorts of environments and at very low levels of the software stack, we
cannot make use of high level configuration APIs that you may find on a
modern desktop.</p>
<p><a class="link" href="pkcs11-conf.html" title="pkcs11.conf">See the manual page</a> for more details
on the format and available options.</p>
<p>Note that user configuration files are not loaded from the home
directory if running inside a setuid or setgid program.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PKCS#11 Configuration: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="index.html" title="p11-kit">
<link rel="next" href="config-example.html" title="Example">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="index.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="config-example.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="config"></a>PKCS#11 Configuration</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="config.html#config-introduction">Consistent configuration</a></span></dt>
<dt><span class="section"><a href="config-example.html">Example</a></span></dt>
<dt><span class="section"><a href="config-files.html">Configuration Files</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="config-introduction"></a>Consistent configuration</h2></div></div></div>
<p>In order for multiple applications on the user's desktop to use
PKCS#11 modules in a consistent manner, there must be a configuration
or registry to specify which modules to load and how to use them. The
PKCS#11 specification does not specify such a configuration standard.
</p>
<p>Because of the multi-library module initialization problem, use of
PKCS#11 modules must be coordinated within an application. p11-kit
provides that coordination. Since coordination is required, it follows
that p11-kit can also implement a consistent module configuration.
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Coding Style: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel-building.html" title="Compiling p11-kit from Source">
<link rel="next" href="devel-testing.html" title="Testing and Code Coverage">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel-building.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-testing.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-building-style"></a>Coding Style</h2></div></div></div>
<p>We use a code style similar to the linux kernel. Use tabs
to indent and spaces to align/wrap beyond the indentation level.</p>
<p>We don't try to guarantee completely robust and problem free
behavior in cases where the caller or system isn't behaving. We
consider these to be outside of our control:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Broken input from callers. We use preconditions
to check input and immediately return. We don't try to provide
error codes for all the various ways callers can screw
around.</p></li>
<li class="listitem">
<p>Out of memory. It is pretty much impossible to handle out
of memory errors correctly. Handling them alongside other errors
is naive and broken. We don't try to guarantee library state
(such as locks or memory leaks) when memory allocation fails.</p>
<p>We do check the results from all memory allocations, but
treat them as unexpected conditions. As a nod to the behavior
of callers of this library, we don't abort on memory allocation
failures. We use preconditions with somewhat sane results.</p>
<p>Exception: when reading files or allocating potentially
unbounded amounts of memory, we should respond robustly to memory
allocation failures.</p>
</li>
</ul></div>
<p>These unexpected conditions indicate a bug either in p11-kit or
in the system. All bets are off once this occurs.</p>
<p>Use the <code class="literal">return_val_xxx()</code> precondition macros to
check for unexpected conditions.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,181 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compiling p11-kit from Source: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel-commands.html" title="Customizing installed commands">
<link rel="next" href="devel-building-style.html" title="Coding Style">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel-commands.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-building-style.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-building"></a>Compiling p11-kit from Source</h2></div></div></div>
<p>This describes how to compiling the p11-kit package from
source code. This is normally only necessary for those wishing to
contribute to the project or package p11-kit.</p>
<p>You can download
<a class="ulink" href="https://github.com/p11-glue/p11-kit/releases" target="_top">tarballs
of the releases</a> of p11-kit or
<a class="ulink" href="https://github.com/p11-glue/p11-kit/" target="_top">check
out the source code from git</a>. This documentation will not
go into all the details of how to get your development environment
set up and instead focus on the what's unique to compiling p11-kit.</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="devel-building-unix"></a>Building on UNIX</h3></div></div></div>
<p>p11-kit uses the standard GNU build system, using autoconf for package
configuration and resolving portability issues, automake for building makefiles
that comply with the GNU Coding Standards, and libtool for building shared
libraries on multiple platforms. The normal sequence for compiling and
installing the p11-kit library is thus:</p>
<pre class="programlisting">
$ ./configure --prefix=/path/to/prefix ...
$ make
$ make install
</pre>
<p>If you've checked out the source code from git, then the
<span class="command"><strong>configure</strong></span> script does not yet exist. So use
the following instead:</p>
<pre class="programlisting">
$ ./autogen.sh --prefix=/path/to/prefix ...
$ make
$ make install
</pre>
<p>The standard options provided by GNU autoconf may be passed to the configure
script. Please see the autoconf documentation or run <code class="literal">./configure --help</code>
for information about the standard options. In particular you probably want to adjust
the <code class="literal">--prefix=/xxx</code> argument depending on your system and development
environment.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="devel-building-dependencies"></a>Optional Dependencies</h3></div></div></div>
<p>On a modern GNU Linux system, p11-kit has no required dependencies other
than the standard C library. However on older UNIX systems, some of the following
may be required.</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><span class="command"><strong>gettext</strong></span> is required if your system doesn't
have the <code class="literal">gettext()</code> functionality for handling message
translation databases. This can be provided by the libintl library from
the <a class="ulink" href="http://www.gnu.org/software/gettext" target="_top">GNU gettext
package</a>.</p></li>
<li class="listitem"><p><span class="command"><strong>pthread</strong></span> is required if your (ancient) system
doesn't have this included in the base system. How this is provided is platform
specific.</p></li>
</ul></div>
<p>In addition p11-kit has several optional dependencies. If these are not available
during the build, then certain features will be disabled.</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><span class="command"><strong>libffi</strong></span> for sharing of PKCS#11 modules
between multiple callers in the same process. It is highly recommended that
this dependency be treated as a required dependency.</p></li>
<li class="listitem"><p><span class="command"><strong>gtk-doc</strong></span> is required to build the reference
manual. Use <code class="literal">--enable-doc</code> to control this
dependency.</p></li>
<li class="listitem"><p><span class="command"><strong>xsltproc</strong></span> is required to build the command
manual pages. Use <code class="literal">--enable-doc</code> to control this
dependency.</p></li>
<li class="listitem"><p><span class="command"><strong>libtasn1</strong></span> is required to build the trust
module and code that interacts with certificates.</p></li>
<li class="listitem"><p><span class="command"><strong>freebl3</strong></span> (developed as part of the NSS
code base) is an optional dependency that may be used to meet policy
requirements of system builders. Enabling this dependency provides no other
advantage.</p></li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="devel-building-configure"></a>Extra Configuration Options</h3></div></div></div>
<p>In addition to the normal options, the configure script in the p11-kit library
supports these additional arguments:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--disable-trust-module</code></span></p></td>
<td><p>Disables building of the trust policy module.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--disable-debug</code>, <code class="option">--enable-debug</code></span></p></td>
<td><p>By default p11-kit is built with debug symbols assertions and
and precondition checks. Enabling the debug option configures even more
detailed debug build, including disabling optimization. Disabling the debug
option is not recommended, as it disables all assertions, preconditions and
internal consistency checks, although it may result it a slightly faster
library.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--enable-doc</code></span></p></td>
<td><p>Enables building of the documentation and command line manual.
The documentation is built in the <code class="literal">doc/html/</code> directory of
the build. Requires the <code class="literal">gtk-doc</code> and <code class="literal">xsltproc</code>
dependencies.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--enable-strict</code></span></p></td>
<td><p>Enables strict checks during building of p11-kit. All
compiler warnings become errors.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-hash-impl=freebl</code></span></p></td>
<td><p>Instead of using internal hash code, link to the freebl3
library and use its hash implementations. The only advantage this brings is to
meet the policy requirements of system builders.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-libtasn1</code>, <code class="option">--without-libtasn1</code></span></p></td>
<td><p>Build with a dependency on the libtasn1 library. This dependency
allows the trust policy module to be built as well as other code that interacts with
certificates.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-module-path</code></span></p></td>
<td><p>Specify the path to look for PKCS#11 modules which were
listed in a module config file with a relative path.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-trust-paths</code></span></p></td>
<td><p>Specify the files or directories to look for certificate
anchors and blocklists. Multiple files and/or directories are specified with
a <code class="literal">:</code> in between them. The first path has the highest
priority when searching for certificates.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-system-config</code></span></p></td>
<td><p>Specify the path to look for p11-kit config files. This
usually defaults to something like <code class="literal">/etc/pkcs11</code></p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--with-user-config</code></span></p></td>
<td><p>Specify the path to look for user specific p11-kit config files. If
specify a path that begins with <code class="literal">~/</code> then this is expanded to the
home directory of the user running p11-kit. If you specify a path that begins with
<code class="literal">~/.config/</code> then this is expanded to the $XDG_CONFIG_HOME directory,
as outlined in the
<a class="ulink" href="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables" target="_top">XDG Base Dir specification</a>.
This option defaults to <code class="literal">~/.pkcs11</code></p></td>
</tr>
</tbody>
</table></div>
<p></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Customizing installed commands: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel-paths.html" title="Packaging PKCS#11 module configs">
<link rel="next" href="devel-building.html" title="Compiling p11-kit from Source">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel-paths.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-building.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-commands"></a>Customizing installed commands</h2></div></div></div>
<p>The <code class="literal">p11-kit</code> tool provides a
<code class="literal">extract-trust</code> command which extracts trust
policy information such as certificate anchors and so on
into files for use with libraries that cannot read this trust
information directly.</p>
<p>In order to be useful the <code class="literal">extract-trust</code>
command needs to be customized per distribution or site. You can
find this file in at <code class="literal">tools/p11-kit-trust-extract.in</code>
in the p11-kit source code.</p>
<p>The command is implemented as a simple script which
performs the various <code class="literal">p11-kit extract</code> commands
necessary to extract the information.</p>
<p>Using this script as a standard way to extract this
information allows for consistency between distributions and ease
of system administration.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Debugging Tips: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel-testing.html" title="Testing and Code Coverage">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel-testing.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><img src="right-insensitive.png" width="16" height="16" border="0"></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-debugging"></a>Debugging Tips</h2></div></div></div>
<p>Unexpected conditions will produce critical warnings by p11-kit.
These are often failed internal preconditions, and usually indicate a
bug either in p11-kit or the software calling it.</p>
<p>You can use the environment variable <code class="literal">P11_KIT_STRICT=yes</code>
to make p11-kit do an <code class="literal">abort()</code> (and core dump depending on
your configuration) when a critical warning occurs.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Packaging PKCS#11 module configs: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="next" href="devel-commands.html" title="Customizing installed commands">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-commands.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-paths"></a>Packaging PKCS#11 module configs</h2></div></div></div>
<p>Developers or packagers of PKCS#11 modules need to install various
files into specific locations so that p11-kit will recognize and load the
module correctly.</p>
<p>You should use <code class="literal">pkg-config</code> as described below
to determine configuration paths. p11-kit installs a
<code class="literal">pkg-config</code> file called <code class="literal">p11-kit-1.pc</code>.
This file contains all the information about the various paths that p11-kit
looks for files at.</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="devel-paths-config"></a>Path to place module configuration</h3></div></div></div>
<p>As described in the <a class="link" href="pkcs11-conf.html#config-module" title="Module Configuration">module configuration</a>
documentation, each PKCS#11 module should install a config file describing
that module. These config files should be installed to a specific directory which
can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_configs</strong></span>
/usr/share/p11-kit/modules</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="devel-paths-modules"></a>Default path for modules with relative paths</h3></div></div></div>
<p>If a <a class="link" href="pkcs11-conf.html#config-module" title="Module Configuration">module configuration</a>
contains a relative path in its <code class="literal">module:</code> setting,
then that module will be loaded from the default module path. This
path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing and Code Coverage: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<link rel="prev" href="devel-building-style.html" title="Coding Style">
<link rel="next" href="devel-debugging.html" title="Debugging Tips">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="devel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="devel-building-style.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-debugging.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-testing"></a>Testing and Code Coverage</h2></div></div></div>
<p>As a general rule changes to p11-kit should have a tests exercising
that change. Use the <code class="literal">make check</code> command to run all
the tests. If you run it from a subdirectory only the tests in that
directory will be run.</p>
<p>To check for memory errors or memory leaks, run <code class="literal">make memcheck</code>
or <code class="literal">make leakcheck</code> respectively. This requires valgrind
be installed.</p>
<p>Build p11-kit with the <code class="option">--enable-coverage</code> configure
option to build code coverage support.</p>
<p>Once you've done that you can either use <code class="literal">make coverage</code>
to build code coverage information. Alternatively (and this is usually
easier) you can use
<a class="ulink" href="http://stef.thewalter.net/2012/12/git-coverage-useful-code-coverage.html" target="_top">
<code class="literal">git coverage</code></a> to easily check whether
you've tested the lines changed by a patch.</p>
<p>A code coverage report is
<a class="ulink" href="https://coveralls.io/github/p11-glue/p11-kit" target="_top">available online</a></p>.
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Building, Packaging, and Contributing to p11-kit: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="p11-kit-Deprecated.html" title="Deprecated">
<link rel="next" href="devel-paths.html" title="Packaging PKCS#11 module configs">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="p11-kit-Deprecated.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel-paths.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="devel"></a>Building, Packaging, and Contributing to p11-kit</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="devel.html#devel-links">Helpful Resources</a></span></dt>
<dt><span class="section"><a href="devel-paths.html">Packaging PKCS#11 module configs</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="devel-paths.html#devel-paths-config">Path to place module configuration</a></span></dt>
<dt><span class="section"><a href="devel-paths.html#devel-paths-modules">Default path for modules with relative paths</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="devel-commands.html">Customizing installed commands</a></span></dt>
<dt><span class="section"><a href="devel-building.html">Compiling p11-kit from Source</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="devel-building.html#devel-building-unix">Building on UNIX</a></span></dt>
<dt><span class="section"><a href="devel-building.html#devel-building-dependencies">Optional Dependencies</a></span></dt>
<dt><span class="section"><a href="devel-building.html#devel-building-configure">Extra Configuration Options</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="devel-building-style.html">Coding Style</a></span></dt>
<dt><span class="section"><a href="devel-testing.html">Testing and Code Coverage</a></span></dt>
<dt><span class="section"><a href="devel-debugging.html">Debugging Tips</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="devel-links"></a>Helpful Resources</h2></div></div></div>
<p>Use the following to find more information about
contributing to p11-kit beyond what's in this manual:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><a class="ulink" href="https://p11-glue.github.io/p11-glue/p11-kit.html" target="_top">Website</a></p></li>
<li class="listitem"><p><a class="ulink" href="mail:p11-glue@lists.freedesktop.org" target="_top">Mailing list</a></p></li>
<li class="listitem"><p><a class="ulink" href="https://github.com/p11-glue/p11-kit/issues/" target="_top">Issue tracker</a></p></li>
</ul></div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

View File

@@ -0,0 +1,101 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>p11-kit: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="next" href="config.html" title="PKCS#11 Configuration">
<meta name="generator" content="GTK-Doc V1.34.0 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="book">
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">p11-kit</p></th></tr></table></div>
<div><p class="releaseinfo">for p11-kit 0.25.5</p></div>
</div>
<hr>
</div>
<div class="toc"><dl class="toc">
<dt><span class="chapter"><a href="config.html">PKCS#11 Configuration</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="config.html#config-introduction">Consistent configuration</a></span></dt>
<dt><span class="section"><a href="config-example.html">Example</a></span></dt>
<dt><span class="section"><a href="config-files.html">Configuration Files</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="sharing.html">Sharing PKCS#11 modules</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="sharing.html#sharing-problem">Multiple consumers of PKCS#11 in a process</a></span></dt>
<dt><span class="section"><a href="sharing-managed.html">Managed modules</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="sharing.html">Proxy Module</a></span></dt>
<dt><span class="chapter"><a href="remoting.html">Remoting / Forwarding</a></span></dt>
<dt><span class="chapter"><a href="trust-module.html">Trust Policy Module</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="trust-module.html#trust-files">Paths loaded by the Module</a></span></dt>
<dt><span class="section"><a href="trust-nss.html">Using the Trust Policy Module with NSS</a></span></dt>
<dt><span class="section"><a href="trust-glib-networking.html">Using the Trust Policy Module with glib-networking</a></span></dt>
<dt><span class="section"><a href="trust-disable.html">Disabling the Trust Policy Module</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="tools.html">Manual Pages</a></span></dt>
<dd><dl>
<dt>
<span class="refentrytitle"><a href="p11-kit.html">p11-kit</a></span><span class="refpurpose"> — Tool for operating on configured PKCS#11 modules</span>
</dt>
<dt>
<span class="refentrytitle"><a href="pkcs11-conf.html">pkcs11.conf</a></span><span class="refpurpose"> — Configuration files for PKCS#11 modules</span>
</dt>
<dt>
<span class="refentrytitle"><a href="trust.html">trust</a></span><span class="refpurpose"> — Tool for operating on the trust policy store</span>
</dt>
</dl></dd>
<dt><span class="chapter"><a href="reference.html">API Reference</a></span></dt>
<dd><dl>
<dt>
<span class="refentrytitle"><a href="p11-kit-Modules.html">Modules</a></span><span class="refpurpose"> — Module loading and initializing</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-URIs.html">URIs</a></span><span class="refpurpose"> — Parsing and formatting PKCS#11 URIs</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-PIN-Callbacks.html">PIN Callbacks</a></span><span class="refpurpose"> — PIN Callbacks</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Utilities.html">Utilities</a></span><span class="refpurpose"> — PKCS#11 utilities</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Future.html">Future</a></span><span class="refpurpose"> — Future Unstable API</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Deprecated.html">Deprecated</a></span><span class="refpurpose"> — Deprecated functions</span>
</dt>
<dt><span class="index"><a href="reference.html#api-index-full">API Index</a></span></dt>
<dt><span class="glossary"><a href="reference.html#annotation-glossary">Annotation Glossary</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="devel.html">Building, Packaging, and Contributing to p11-kit</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="devel.html#devel-links">Helpful Resources</a></span></dt>
<dt><span class="section"><a href="devel-paths.html">Packaging PKCS#11 module configs</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="devel-paths.html#devel-paths-config">Path to place module configuration</a></span></dt>
<dt><span class="section"><a href="devel-paths.html#devel-paths-modules">Default path for modules with relative paths</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="devel-commands.html">Customizing installed commands</a></span></dt>
<dt><span class="section"><a href="devel-building.html">Compiling p11-kit from Source</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="devel-building.html#devel-building-unix">Building on UNIX</a></span></dt>
<dt><span class="section"><a href="devel-building.html#devel-building-dependencies">Optional Dependencies</a></span></dt>
<dt><span class="section"><a href="devel-building.html#devel-building-configure">Extra Configuration Options</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="devel-building-style.html">Coding Style</a></span></dt>
<dt><span class="section"><a href="devel-testing.html">Testing and Code Coverage</a></span></dt>
<dt><span class="section"><a href="devel-debugging.html">Debugging Tips</a></span></dt>
</dl></dd>
</dl></div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

@@ -0,0 +1,460 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deprecated: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="p11-kit-Future.html" title="Future">
<link rel="next" href="devel.html" title="Building, Packaging, and Contributing to p11-kit">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#p11-kit-Deprecated.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="p11-kit-Future.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="devel.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="p11-kit-Deprecated"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="p11-kit-Deprecated.top_of_page"></a>Deprecated</span></h2>
<p>Deprecated — Deprecated functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="p11-kit-Deprecated.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()">p11_kit_initialize_registered</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()">p11_kit_finalize_registered</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST_PTR</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-modules" title="p11_kit_registered_modules ()">p11_kit_registered_modules</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-module-to-name" title="p11_kit_registered_module_to_name ()">p11_kit_registered_module_to_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST_PTR</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-name-to-module" title="p11_kit_registered_name_to_module ()">p11_kit_registered_name_to_module</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-option" title="p11_kit_registered_option ()">p11_kit_registered_option</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()">p11_kit_initialize_module</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-load-initialize-module" title="p11_kit_load_initialize_module ()">p11_kit_load_initialize_module</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()">p11_kit_finalize_module</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="p11-kit-Deprecated.html#P11-KIT-DEPRECATED-FOR:CAPS" title="P11_KIT_DEPRECATED_FOR()">P11_KIT_DEPRECATED_FOR</a><span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-Deprecated.description"></a><h2>Description</h2>
<p>These functions have been deprecated from p11-kit and are not recommended for
general usage. In large part they were deprecated because they did not adequately
insulate multiple callers of a PKCS#11 module from another, and could not
support the 'managed' mode needed to do this.</p>
</div>
<div class="refsect1">
<a name="p11-kit-Deprecated.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="p11-kit-initialize-registered"></a><h3>p11_kit_initialize_registered ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_initialize_registered (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_initialize_registered</code> is deprecated and should not be used in newly-written code.</p>
<p>Since: 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a> instead.</p>
</div>
<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-Deprecated.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-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-initialize-registered.returns"></a><h4>Returns</h4>
<p> CKR_OK if the initialization succeeded, or an error code.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-finalize-registered"></a><h3>p11_kit_finalize_registered ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_finalize_registered (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_finalize_registered</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-modules-release" title="p11_kit_modules_release ()"><code class="function">p11_kit_modules_release()</code></a> instead.</p>
</div>
<p>Finalize all the registered PKCS#11 modules. These should have been
initialized with <a class="link" href="p11-kit-Deprecated.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-Deprecated.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-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-finalize-registered.returns"></a><h4>Returns</h4>
<p> CKR_OK if the finalization succeeded, or an error code.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-registered-modules"></a><h3>p11_kit_registered_modules ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span> *
p11_kit_registered_modules (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_registered_modules</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a> instead.</p>
</div>
<p>Get a list of all the registered PKCS#11 modules. This list will be valid
once the <a class="link" href="p11-kit-Deprecated.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</p>
<code class="code">CK_FUNCTION_LIST_PTR</code> pointers.
<p>The returned modules are unmanaged.</p>
<div class="refsect3">
<a name="p11-kit-registered-modules.returns"></a><h4>Returns</h4>
<p> A list of all the registered modules. Use the <code class="function">free()</code> function to
free the list.</p>
</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><span class="type">CK_FUNCTION_LIST_PTR</span> module</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_registered_module_to_name</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-module-get-name" title="p11_kit_module_get_name ()"><code class="function">p11_kit_module_get_name()</code></a> instead.</p>
</div>
<p>Get the name of a registered PKCS#11 module.</p>
<p>You can use <a class="link" href="p11-kit-Deprecated.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="refsect3">
<a name="p11-kit-registered-module-to-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>pointer to a registered module</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-registered-module-to-name.returns"></a><h4>Returns</h4>
<p> A newly allocated string containing the module name, or</p>
<code class="code">NULL</code> if no such registered module exists. Use <code class="function">free()</code> to
<p> free this string.</p>
</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"><span class="returnvalue">CK_FUNCTION_LIST_PTR</span>
p11_kit_registered_name_to_module (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_registered_name_to_module</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-module-for-name" title="p11_kit_module_for_name ()"><code class="function">p11_kit_module_for_name()</code></a> instead.</p>
</div>
<p>Lookup a registered PKCS#11 module by its name. This name is specified by
the registered module configuration.</p>
<div class="refsect3">
<a name="p11-kit-registered-name-to-module.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>name of a registered module</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-registered-name-to-module.returns"></a><h4>Returns</h4>
<p> a pointer to a PKCS#11 module, or <code class="code">NULL</code> if this name was
not found.</p>
</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><span class="type">CK_FUNCTION_LIST_PTR</span> module</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *field</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_registered_option</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-config-option" title="p11_kit_config_option ()"><code class="function">p11_kit_config_option()</code></a> instead.</p>
</div>
<p>Lookup a configured option for a registered PKCS#11 module. If a</p>
<code class="code">NULL</code> module argument is specified, then this will lookup
<p>the configuration option in the global config file.</p>
<div class="refsect3">
<a name="p11-kit-registered-option.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>a pointer to a registered module</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>field</p></td>
<td class="parameter_description"><p>the name of the option to lookup.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-registered-option.returns"></a><h4>Returns</h4>
<p> A newly allocated string containing the option value, or</p>
<code class="code">NULL</code> if the registered module or the option were not found.
<p> Use <code class="function">free()</code> to free the returned string.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-initialize-module"></a><h3>p11_kit_initialize_module ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_initialize_module (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST_PTR</span> module</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_initialize_module</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-module-initialize" title="p11_kit_module_initialize ()"><code class="function">p11_kit_module_initialize()</code></a> instead.</p>
</div>
<p>Initialize an arbitrary PKCS#11 module. Normally using the
<a class="link" href="p11-kit-Deprecated.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</p>
<code class="code">C_Initialize</code> method. This function will call
<code class="code">C_Initialize</code> as necessary.
<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-Deprecated.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-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-initialize-module.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>loaded module to initialize.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-initialize-module.returns"></a><h4>Returns</h4>
<p> CKR_OK if the initialization was successful.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-load-initialize-module"></a><h3>p11_kit_load_initialize_module ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_load_initialize_module (<em class="parameter"><code>const <span class="type">char</span> *module_path</code></em>,
<em class="parameter"><code><span class="type">CK_FUNCTION_LIST_PTR</span> *module</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_load_initialize_module</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-module-load" title="p11_kit_module_load ()"><code class="function">p11_kit_module_load()</code></a> instead.</p>
</div>
<p>Load an arbitrary PKCS#11 module from a dynamic library file, and
initialize it. Normally using the <a class="link" href="p11-kit-Deprecated.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</p>
<code class="code">C_Initialize</code> as necessary.
<p>If a module has already been loaded, then use of this function is unnecesasry.
Instead use the <a class="link" href="p11-kit-Deprecated.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-Deprecated.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-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-load-initialize-module.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>module_path</p></td>
<td class="parameter_description"><p>full file path of module library</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>location to place loaded module pointer</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-load-initialize-module.returns"></a><h4>Returns</h4>
<p> CKR_OK if the initialization was successful.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-finalize-module"></a><h3>p11_kit_finalize_module ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_finalize_module (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST_PTR</span> module</code></em>);</pre>
<div class="warning">
<p><code class="literal">p11_kit_finalize_module</code> is deprecated and should not be used in newly-written code.</p>
<p>Since 0.19.0: Use <a class="link" href="p11-kit-Modules.html#p11-kit-module-finalize" title="p11_kit_module_finalize ()"><code class="function">p11_kit_module_finalize()</code></a> and
<a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()"><code class="function">p11_kit_module_release()</code></a> instead.</p>
</div>
<p>Finalize an arbitrary PKCS#11 module. The module must have been initialized
using <a class="link" href="p11-kit-Deprecated.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-Deprecated.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 not
call the module's <code class="code">C_Finalize</code> method. This function will call</p>
<code class="code">C_Finalize</code> as necessary.
<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-Deprecated.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-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-finalize-module.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>loaded module to finalize.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-finalize-module.returns"></a><h4>Returns</h4>
<p> CKR_OK if the finalization was successful.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="P11-KIT-DEPRECATED-FOR:CAPS"></a><h3>P11_KIT_DEPRECATED_FOR()</h3>
<pre class="programlisting">#define P11_KIT_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
</pre>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,833 @@
<!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: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="reference.html" title="API Reference">
<link rel="next" href="p11-kit-URIs.html" title="URIs">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#p11-kit-Modules.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="reference.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="p11-kit-URIs.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></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 class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="p11-kit-Modules.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST</span> **
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load-and-initialize" title="p11_kit_modules_load_and_initialize ()">p11_kit_modules_load_and_initialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-finalize-and-release" title="p11_kit_modules_finalize_and_release ()">p11_kit_modules_finalize_and_release</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST</span> **
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()">p11_kit_modules_load</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-initialize" title="p11_kit_modules_initialize ()">p11_kit_modules_initialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-finalize" title="p11_kit_modules_finalize ()">p11_kit_modules_finalize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-release" title="p11_kit_modules_release ()">p11_kit_modules_release</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-load" title="p11_kit_module_load ()">p11_kit_module_load</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-initialize" title="p11_kit_module_initialize ()">p11_kit_module_initialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_RV</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-finalize" title="p11_kit_module_finalize ()">p11_kit_module_finalize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()">p11_kit_module_release</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CK_FUNCTION_LIST</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-for-name" title="p11_kit_module_for_name ()">p11_kit_module_for_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-name" title="p11_kit_module_get_name ()">p11_kit_module_get_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-flags" title="p11_kit_module_get_flags ()">p11_kit_module_get_flags</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-filename" title="p11_kit_module_get_filename ()">p11_kit_module_get_filename</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Modules.html#p11-kit-config-option" title="p11_kit_config_option ()">p11_kit_config_option</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-Modules.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-CRITICAL:CAPS" title="P11_KIT_MODULE_CRITICAL">P11_KIT_MODULE_CRITICAL</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS" title="P11_KIT_MODULE_UNMANAGED">P11_KIT_MODULE_UNMANAGED</a></td>
</tr>
</tbody>
</table></div>
</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 configured so that applications
or libraries know that they should load it.</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. To do this modules are managed by p11-kit.
This means that various unsafe methods are coordinated between callers. Unmanaged
modules are simply the raw PKCS#11 module pointers without p11-kit getting in the
way. It is highly recommended that the default managed behavior is used.</p>
<p>The functions here provide support for initializing configured modules. The
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a> function should be used to load and initialize
the configured modules. When done, the <a class="link" href="p11-kit-Modules.html#p11-kit-modules-release" title="p11_kit_modules_release ()"><code class="function">p11_kit_modules_release()</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-config-option" title="p11_kit_config_option ()"><code class="function">p11_kit_config_option()</code></a> can be used to access other parts
of the module configuration.</p>
<p>If a consumer wishes to load an arbitrary PKCS#11 module that's not
configured use <a class="link" href="p11-kit-Modules.html#p11-kit-module-load" title="p11_kit_module_load ()"><code class="function">p11_kit_module_load()</code></a> to do so. And use <a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()"><code class="function">p11_kit_module_release()</code></a>
to later release it.</p>
<p>Modules are represented by a pointer to their <code class="code">CK_FUNCTION_LIST</code>
entry points.</p>
</div>
<div class="refsect1">
<a name="p11-kit-Modules.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="p11-kit-modules-load-and-initialize"></a><h3>p11_kit_modules_load_and_initialize ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_FUNCTION_LIST</span> **
p11_kit_modules_load_and_initialize (<em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre>
<p>Load and initialize configured modules.</p>
<p>If a critical module fails to load or initialize then the function will
return <code class="literal">NULL</code>. Non-critical modules will be skipped
and not included in the returned module list.</p>
<p>Use <a class="link" href="p11-kit-Modules.html#p11-kit-modules-finalize-and-release" title="p11_kit_modules_finalize_and_release ()"><code class="function">p11_kit_modules_finalize_and_release()</code></a> when you're done with the
modules returned by this function.</p>
<p>The <em class="parameter"><code>flags</code></em>
allowed by this function, as well as their meaning, are the
same as with <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>.</p>
<div class="refsect3">
<a name="p11-kit-modules-load-and-initialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags to use to load the modules</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-modules-load-and-initialize.returns"></a><h4>Returns</h4>
<p> a <code class="literal">NULL</code> terminated list of modules, or
<code class="literal">NULL</code> on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-modules-finalize-and-release"></a><h3>p11_kit_modules_finalize_and_release ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_modules_finalize_and_release (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> **modules</code></em>);</pre>
<p>Finalize and then release the a set of loaded PKCS#11 modules.</p>
<p>The modules may be either managed or unmanaged. The array containing
the module pointers is also freed by this function.</p>
<p>Modules are released even if their finalization returns an error code.
Managed modules will not be actually finalized or released until all
callers using them have done so.</p>
<p>For managed modules the <code class="literal">C_Finalize</code> function
is overridden so that multiple callers can finalize the same
modules. In addition for managed modules multiple callers can
finalize from different threads, and still guarantee consistent
thread-safe behavior.</p>
<p>For unmanaged modules if multiple callers try to finalize
a module, then one of the calls will return
<code class="literal">CKR_CRYPTOKI_NOT_INITIALIZED</code> according to the
PKCS#11 specification. In addition there are no guarantees that
thread-safe behavior will occur if multiple callers initialize from
different threads.</p>
<div class="refsect3">
<a name="p11-kit-modules-finalize-and-release.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>modules</p></td>
<td class="parameter_description"><p>the modules to release</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-modules-load"></a><h3>p11_kit_modules_load ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_FUNCTION_LIST</span> **
p11_kit_modules_load (<em class="parameter"><code>const <span class="type">char</span> *reserved</code></em>,
<em class="parameter"><code><span class="type">int</span> flags</code></em>);</pre>
<p>Load the configured PKCS#11 modules.</p>
<p>If <em class="parameter"><code>flags</code></em>
contains the <a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS" title="P11_KIT_MODULE_UNMANAGED"><code class="literal">P11_KIT_MODULE_UNMANAGED</code></a> flag, then the
modules will be not be loaded in 'managed' mode regardless of its
configuration. This is not recommended for general usage.</p>
<p>If <em class="parameter"><code>flags</code></em>
contains the <a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-CRITICAL:CAPS" title="P11_KIT_MODULE_CRITICAL"><code class="literal">P11_KIT_MODULE_CRITICAL</code></a> flag then the
modules will all be treated as 'critical', regardless of the module
configuration. This means that a failure to load any module will
cause this function to fail.</p>
<p>For unmanaged modules there is no guarantee to the state of the
modules. Other callers may be using the modules. Using unmanaged
modules haphazardly is not recommended for this reason. Some
modules (such as those configured with RPC) cannot be loaded in
unmanaged mode, and will be skipped.</p>
<p>If <em class="parameter"><code>flags</code></em>
contains the <code class="literal">P11_KIT_MODULE_TRUSTED</code> flag then only the
marked as trusted modules will be loaded.</p>
<p>Use <a class="link" href="p11-kit-Modules.html#p11-kit-modules-release" title="p11_kit_modules_release ()"><code class="function">p11_kit_modules_release()</code></a> to release the modules returned by
this function.</p>
<p>If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-modules-load.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>reserved</p></td>
<td class="parameter_description"><p>set to <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags to use to load the module</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-modules-load.returns"></a><h4>Returns</h4>
<p> a null terminated list of modules represented as PKCS#11
function lists, or <code class="literal">NULL</code> on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-modules-initialize"></a><h3>p11_kit_modules_initialize ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_modules_initialize (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> **modules</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-Future.html#p11-kit-destroyer" title="p11_kit_destroyer ()"><span class="type">p11_kit_destroyer</span></a> failure_callback</code></em>);</pre>
<p>Initialize all the modules in the <em class="parameter"><code>modules</code></em>
list by calling their
<code class="literal">C_Initialize</code> function.</p>
<p>For managed modules the <code class="literal">C_Initialize</code> function
is overridden so that multiple callers can initialize the same
modules. In addition for managed modules multiple callers can
initialize from different threads, and still guarantee consistent
thread-safe behavior.</p>
<p>For unmanaged modules if multiple callers try to initialize
a module, then one of the calls will return
<code class="literal">CKR_CRYPTOKI_ALREADY_INITIALIZED</code> according to the
PKCS#11 specification. In addition there are no guarantees that
thread-safe behavior will occur if multiple callers initialize from
different threads.</p>
<p>When a module fails to initialize it is removed from the <em class="parameter"><code>modules</code></em>
list.
If the <em class="parameter"><code>failure_callback</code></em>
is not <code class="literal">NULL</code> then it is called with the modules that
fail to initialize. For example, you may pass <a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()"><code class="function">p11_kit_module_release()</code></a>
as a <em class="parameter"><code>failure_callback</code></em>
if the <em class="parameter"><code>modules</code></em>
list was loaded wit <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>.</p>
<p>The return value will return the failure code of the last critical
module that failed to initialize. Non-critical module failures do not affect
the return value. If no critical modules failed to initialize then the
return value will be <code class="literal">CKR_OK</code>.</p>
<p>When modules are removed, the list will be <code class="literal">NULL</code> terminated at the
appropriate place so it can continue to be used as a modules list.</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>
<div class="refsect3">
<a name="p11-kit-modules-initialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>modules</p></td>
<td class="parameter_description"><p>a <code class="literal">NULL</code> terminated list of modules</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>failure_callback</p></td>
<td class="parameter_description"><p>called with modules that fail to initialize</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-modules-initialize.returns"></a><h4>Returns</h4>
<p> <code class="literal">CKR_OK</code> or the failure code of the last critical
module that failed to initialize.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-modules-finalize"></a><h3>p11_kit_modules_finalize ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_modules_finalize (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> **modules</code></em>);</pre>
<p>Finalize each module in the <em class="parameter"><code>modules</code></em>
list by calling its
<code class="literal">C_Finalize</code> function. Regardless of failures, all
<em class="parameter"><code>modules</code></em>
will have their <code class="literal">C_Finalize</code> function called.</p>
<p>If a module returns a failure from its <code class="literal">C_Finalize</code>
method it will be returned. If multiple modules fail, the last failure
will be returned.</p>
<p>For managed modules the <code class="literal">C_Finalize</code> function
is overridden so that multiple callers can finalize the same
modules. In addition for managed modules multiple callers can
finalize from different threads, and still guarantee consistent
thread-safe behavior.</p>
<p>For unmanaged modules if multiple callers try to finalize
a module, then one of the calls will return
<code class="literal">CKR_CRYPTOKI_NOT_INITIALIZED</code> according to the
PKCS#11 specification. In addition there are no guarantees that
thread-safe behavior will occur if multiple callers finalize from
different threads.</p>
<div class="refsect3">
<a name="p11-kit-modules-finalize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>modules</p></td>
<td class="parameter_description"><p>a <code class="literal">NULL</code> terminated list of modules</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-modules-finalize.returns"></a><h4>Returns</h4>
<p> <code class="literal">CKR_OK</code> or the failure code of the last
module that failed to finalize</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-modules-release"></a><h3>p11_kit_modules_release ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_modules_release (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> **modules</code></em>);</pre>
<p>Release the a set of loaded PKCS#11 modules.</p>
<p>The modules may be either managed or unmanaged. The array containing
the module pointers is also freed by this function.</p>
<p>Managed modules will not be actually released until all
callers using them have done so. If the modules were initialized, they
should have been finalized first.</p>
<div class="refsect3">
<a name="p11-kit-modules-release.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>modules</p></td>
<td class="parameter_description"><p>the modules to release</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-load"></a><h3>p11_kit_module_load ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_FUNCTION_LIST</span> *
p11_kit_module_load (<em class="parameter"><code>const <span class="type">char</span> *module_path</code></em>,
<em class="parameter"><code><span class="type">int</span> flags</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-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a> function
is preferred.</p>
<p>A full file path or just (path/)filename relative to
P11_MODULE_PATH are accepted.</p>
<p>Using this function to load modules allows coordination between multiple
callers of the same module in a single process. If <em class="parameter"><code>flags</code></em>
contains the
<a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS" title="P11_KIT_MODULE_UNMANAGED"><code class="literal">P11_KIT_MODULE_UNMANAGED</code></a> flag, then the modules will be not be loaded
in 'managed' mode and not be coordinated. This is not recommended
for general usage.</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 should be released with <a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()"><code class="function">p11_kit_module_release()</code></a>.</p>
<p>If this function fails, then an error message will be available via the
<a class="link" href="p11-kit-Utilities.html#p11-kit-message" title="p11_kit_message ()"><code class="function">p11_kit_message()</code></a> function.</p>
<div class="refsect3">
<a name="p11-kit-module-load.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>module_path</p></td>
<td class="parameter_description"><p>relative or full file path of module library</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags to use when loading the module</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-load.returns"></a><h4>Returns</h4>
<p> the loaded module PKCS#11 functions or <code class="literal">NULL</code> on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-initialize"></a><h3>p11_kit_module_initialize ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_module_initialize (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Initialize a PKCS#11 module by calling its <code class="literal">C_Initialize</code>
function.</p>
<p>For managed modules the <code class="literal">C_Initialize</code> function
is overridden so that multiple callers can initialize the same
modules. In addition for managed modules multiple callers can
initialize from different threads, and still guarantee consistent
thread-safe behavior.</p>
<p>For unmanaged modules if multiple callers try to initialize
a module, then one of the calls will return
<code class="literal">CKR_CRYPTOKI_ALREADY_INITIALIZED</code> according to the
PKCS#11 specification. In addition there are no guarantees that
thread-safe behavior will occur if multiple callers initialize from
different threads.</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>
<div class="refsect3">
<a name="p11-kit-module-initialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>the module to initialize</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-initialize.returns"></a><h4>Returns</h4>
<p> <code class="literal">CKR_OK</code> or a failure code</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-finalize"></a><h3>p11_kit_module_finalize ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_RV</span>
p11_kit_module_finalize (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Finalize a PKCS#11 module by calling its <code class="literal">C_Finalize</code>
function.</p>
<p>For managed modules the <code class="literal">C_Finalize</code> function
is overridden so that multiple callers can finalize the same
modules. In addition for managed modules multiple callers can
finalize from different threads, and still guarantee consistent
thread-safe behavior.</p>
<p>For unmanaged modules if multiple callers try to finalize
a module, then one of the calls will return
<code class="literal">CKR_CRYPTOKI_NOT_INITIALIZED</code> according to the
PKCS#11 specification. In addition there are no guarantees that
thread-safe behavior will occur if multiple callers finalize from
different threads.</p>
<div class="refsect3">
<a name="p11-kit-module-finalize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>the module to finalize</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-finalize.returns"></a><h4>Returns</h4>
<p> <code class="literal">CKR_OK</code> or a failure code</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-release"></a><h3>p11_kit_module_release ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_module_release (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Release the a loaded PKCS#11 modules.</p>
<p>The module may be either managed or unmanaged. The <code class="literal">C_Finalize</code>
function will be called if no other callers are using this module.</p>
<div class="refsect3">
<a name="p11-kit-module-release.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>the module to release</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-for-name"></a><h3>p11_kit_module_for_name ()</h3>
<pre class="programlisting"><span class="returnvalue">CK_FUNCTION_LIST</span> *
p11_kit_module_for_name (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> **modules</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>Look through the list of <em class="parameter"><code>modules</code></em>
and return the module whose <em class="parameter"><code>name</code></em>
matches.</p>
<p>Only configured modules have names. Configured modules are loaded by
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>. The module passed to this function can be either
managed or unmanaged.</p>
<p>The return value is not copied or duplicated in anyway. It is still
'owned' by the <em class="parameter"><code>modules</code></em>
list.</p>
<div class="refsect3">
<a name="p11-kit-module-for-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>modules</p></td>
<td class="parameter_description"><p>a list of modules to look through</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of the module to find</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-for-name.returns"></a><h4>Returns</h4>
<p> the module which matches the name, or <code class="literal">NULL</code> if no match.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-get-name"></a><h3>p11_kit_module_get_name ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
p11_kit_module_get_name (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Get the configured name of the PKCS#11 module.</p>
<p>Configured modules are loaded by <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>. The module
passed to this function can be either managed or unmanaged. Non
configured modules will return <code class="literal">NULL</code>.</p>
<p>Use <code class="function">free()</code> to release the return value when you're done with it.</p>
<div class="refsect3">
<a name="p11-kit-module-get-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>pointer to a loaded module</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-get-name.returns"></a><h4>Returns</h4>
<p> a newly allocated string containing the module name, or</p>
<code class="code">NULL</code> if the module is not a configured module
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-get-flags"></a><h3>p11_kit_module_get_flags ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
p11_kit_module_get_flags (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Get the flags for this module.</p>
<p>The <a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS" title="P11_KIT_MODULE_UNMANAGED"><code class="literal">P11_KIT_MODULE_UNMANAGED</code></a> flag will be set if the module is not
managed by p11-kit. It is a raw PKCS#11 module function list.</p>
<p>The <a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-CRITICAL:CAPS" title="P11_KIT_MODULE_CRITICAL"><code class="literal">P11_KIT_MODULE_CRITICAL</code></a> flag will be set if the module is configured
to be critical, and not be skipped over if it fails to initialize or
load. This flag is also set for modules that are not configured, but have
been loaded in another fashion.</p>
<div class="refsect3">
<a name="p11-kit-module-get-flags.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>the module</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-get-flags.returns"></a><h4>Returns</h4>
<p> the flags for the module</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-module-get-filename"></a><h3>p11_kit_module_get_filename ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
p11_kit_module_get_filename (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>);</pre>
<p>Get the configured name of the PKCS#11 module.</p>
<p>Configured modules are loaded by <a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>. The module
passed to this function can be either managed or unmanaged. Non
configured modules will return <code class="literal">NULL</code>.</p>
<p>Use <code class="function">free()</code> to release the return value when you're done with it.</p>
<div class="refsect3">
<a name="p11-kit-module-get-filename.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>pointer to a loaded module</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-module-get-filename.returns"></a><h4>Returns</h4>
<p> a newly allocated string containing the module name, or</p>
<code class="code">NULL</code> if the module is not a configured module
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-config-option"></a><h3>p11_kit_config_option ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
p11_kit_config_option (<em class="parameter"><code><span class="type">CK_FUNCTION_LIST</span> *module</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *option</code></em>);</pre>
<p>Retrieve the value for a configured option.</p>
<p>If <em class="parameter"><code>module</code></em>
is <code class="literal">NULL</code>, then the global option with the given name will
be retrieved. Otherwise <em class="parameter"><code>module</code></em>
should point to a configured loaded module.
If no such <em class="parameter"><code>option</code></em>
or configured <em class="parameter"><code>module</code></em>
exists, then <code class="literal">NULL</code> will be returned.</p>
<p>Use <code class="function">free()</code> to release the returned value.</p>
<div class="refsect3">
<a name="p11-kit-config-option.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>module</p></td>
<td class="parameter_description"><p>the module to retrieve the option for, or <code class="literal">NULL</code> for global options</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>option</p></td>
<td class="parameter_description"><p>the option to retrieve</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-config-option.returns"></a><h4>Returns</h4>
<p> the option value or <code class="literal">NULL</code></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="p11-kit-Modules.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="P11-KIT-MODULE-CRITICAL:CAPS"></a><h3>P11_KIT_MODULE_CRITICAL</h3>
<pre class="programlisting">#define P11_KIT_MODULE_CRITICAL 1
</pre>
<p>Flag to load a module in 'critical' mode. Failure to load a critical module
will prevent all other modules from loading. A failure when loading a
non-critical module skips that module.</p>
</div>
<hr>
<div class="refsect2">
<a name="P11-KIT-MODULE-UNMANAGED:CAPS"></a><h3>P11_KIT_MODULE_UNMANAGED</h3>
<pre class="programlisting">#define P11_KIT_MODULE_UNMANAGED 1
</pre>
<p>Module is loaded in non 'managed' mode. This is not recommended,
disables many features, and prevents coordination between multiple
callers of the same module.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,892 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PIN Callbacks: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="p11-kit-URIs.html" title="URIs">
<link rel="next" href="p11-kit-Utilities.html" title="Utilities">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#p11-kit-PIN-Callbacks.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="p11-kit-URIs.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="p11-kit-Utilities.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="p11-kit-PIN-Callbacks"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="p11-kit-PIN-Callbacks.top_of_page"></a>PIN Callbacks</span></h2>
<p>PIN Callbacks — PIN Callbacks</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="p11-kit-PIN-Callbacks.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new" title="p11_kit_pin_new ()">p11_kit_pin_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-buffer" title="p11_kit_pin_new_for_buffer ()">p11_kit_pin_new_for_buffer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-string" title="p11_kit_pin_new_for_string ()">p11_kit_pin_new_for_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const unsigned <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-value" title="p11_kit_pin_get_value ()">p11_kit_pin_get_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-length" title="p11_kit_pin_get_length ()">p11_kit_pin_get_length</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-ref" title="p11_kit_pin_ref ()">p11_kit_pin_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()">p11_kit_pin_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()">p11_kit_pin_register_callback</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unregister-callback" title="p11_kit_pin_unregister_callback ()">p11_kit_pin_unregister_callback</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-callback" title="p11_kit_pin_callback ()">*p11_kit_pin_callback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-request" title="p11_kit_pin_request ()">p11_kit_pin_request</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-destroy-func" title="p11_kit_pin_destroy_func ()">*p11_kit_pin_destroy_func</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-file-callback" title="p11_kit_pin_file_callback ()">p11_kit_pin_file_callback</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-PIN-Callbacks.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin">P11KitPin</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPinFlags" title="enum P11KitPinFlags">P11KitPinFlags</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FALLBACK:CAPS" title="P11_KIT_PIN_FALLBACK">P11_KIT_PIN_FALLBACK</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-PIN-Callbacks.description"></a><h2>Description</h2>
<p>Applications can register a callback which will be called to provide a
password associated with a given pin source.</p>
<p>PKCS#11 URIs can contain a 'pin-source' attribute. The value of this attribute
is application dependent, but often references a file containing a PIN to
use.</p>
<p>Using these functions, an applications or libraries can register a
callback with <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()"><code class="function">p11_kit_pin_register_callback()</code></a> to be called when a given
'pin-source' attribute value is requested. The application can then prompt
the user or retrieve a PIN for the given context. These registered
callbacks are only relevant and valid within the current process.</p>
<p>A fallback callback can be registered by passing the <a class="link" href="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FALLBACK:CAPS" title="P11_KIT_PIN_FALLBACK"><code class="literal">P11_KIT_PIN_FALLBACK</code></a>
value to <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()"><code class="function">p11_kit_pin_register_callback()</code></a>. This fallback callback will be
called for every 'pin-source' attribute request for which no callback has been
directly registered.</p>
<p>To request a PIN for a given 'pin-source' attribute, use the
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-request" title="p11_kit_pin_request ()"><code class="function">p11_kit_pin_request()</code></a> function. If this function returns <code class="literal">NULL</code> then either
no callbacks were registered or none of them could handle the request.</p>
<p>If multiple callbacks are registered for the same PIN source, then they are
called in last-registered-first-called order. They are called in turn until
one of them can handle the request. Fallback callbacks are not called if
a callback was registered specifically for a requested 'pin-source' attribute.</p>
<p>PINs themselves are handled inside of P11KitPin structures. These are thread
safe and allow the callback to specify how the PIN is stored in memory
and freed. A callback can use <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-string" title="p11_kit_pin_new_for_string ()"><code class="function">p11_kit_pin_new_for_string()</code></a> or related
functions to create a PIN to be returned.</p>
<p>For example in order to handle the following PKCS#11 URI with a 'pin-source'
attribute</p>
<code class="code"><div class="literallayout"><p><br>
     pkcs11:id=\%69\%95\%3e\%5c\%f4\%bd\%ec\%91;pin-source=my-application<br>
</p></div></code><p>an application could register a callback like this:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">static</span><span class="w"> </span><span class="n">P11KitPin</span><span class="o">*</span>
<span class="nf">my_application_pin_callback</span><span class="w"> </span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">pin_source</span><span class="p">,</span><span class="w"> </span><span class="n">P11KitUri</span><span class="w"> </span><span class="o">*</span><span class="n">pin_uri</span><span class="p">,</span>
<span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">pin_description</span><span class="p">,</span><span class="w"> </span><span class="n">P11KitPinFlags</span><span class="w"> </span><span class="n">pin_flags</span><span class="p">,</span>
<span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="n">callback_data</span><span class="p">)</span>
<span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">p11_kit_pin_new_for_string</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;pin-value&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">p11_kit_pin_register_callback</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;my-application&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">my_application_pin_callback</span><span class="p">,</span>
<span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="refsect1">
<a name="p11-kit-PIN-Callbacks.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="p11-kit-pin-new"></a><h3>p11_kit_pin_new ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_new (<em class="parameter"><code>const unsigned <span class="type">char</span> *value</code></em>,
<em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
<p>Create a new P11KitPin with the given PIN value. This function is
usually used from within registered PIN callbacks.</p>
<p>Exactly <em class="parameter"><code>length</code></em>
bytes from <em class="parameter"><code>value</code></em>
are used. Null terminated strings,
or encodings are not considered. A copy of the <em class="parameter"><code>value</code></em>
will be made.</p>
<div class="refsect3">
<a name="p11-kit-pin-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the value of the PIN</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the length of <em class="parameter"><code>value</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-new.returns"></a><h4>Returns</h4>
<p> The newly allocated P11KitPin, which should be freed with
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a> when no longer needed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-new-for-buffer"></a><h3>p11_kit_pin_new_for_buffer ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_new_for_buffer (<em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> length</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-destroy-func" title="p11_kit_pin_destroy_func ()"><span class="type">p11_kit_pin_destroy_func</span></a> destroy</code></em>);</pre>
<p>Create a new P11KitPin which will use <em class="parameter"><code>buffer</code></em>
for the PIN value.
This function is usually used from within registered PIN callbacks.</p>
<p>The buffer will not be copied. String encodings and null characters
are not considered.</p>
<p>When the last reference to this PIN is lost, then the <em class="parameter"><code>destroy</code></em>
callback
function will be called passing <em class="parameter"><code>buffer</code></em>
as an argument. This allows the
caller to use a buffer as a PIN without copying it.</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">buffer</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">malloc</span><span class="w"> </span><span class="p">(</span><span class="mi">128</span><span class="p">);</span>
<span class="n">P11KitPin</span><span class="w"> </span><span class="o">*</span><span class="n">pin</span><span class="p">;</span>
<span class="w"> </span><span class="p">....</span>
<span class="n">pin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">p11_kit_pin_new_for_buffer</span><span class="w"> </span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span><span class="w"> </span><span class="mi">128</span><span class="p">,</span><span class="w"> </span><span class="n">free</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<div class="refsect3">
<a name="p11-kit-pin-new-for-buffer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>the value of the PIN</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the length of <em class="parameter"><code>buffer</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>destroy</p></td>
<td class="parameter_description"><p>if not <code class="literal">NULL</code>, then called when PIN is destroyed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-new-for-buffer.returns"></a><h4>Returns</h4>
<p> The newly allocated P11KitPin, which should be freed with
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a> when no longer needed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-new-for-string"></a><h3>p11_kit_pin_new_for_string ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_new_for_string (<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>Create a new P11KitPin for the given null-terminated string, such as a
password. This function is usually used from within registered
PIN callbacks.</p>
<p>The PIN will consist of the string not including the null terminator.
String encoding is not considered. A copy of the <em class="parameter"><code>value</code></em>
will be made.</p>
<div class="refsect3">
<a name="p11-kit-pin-new-for-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the value of the PIN</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-new-for-string.returns"></a><h4>Returns</h4>
<p> The newly allocated P11KitPin, which should be freed with
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a> when no longer needed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-get-value"></a><h3>p11_kit_pin_get_value ()</h3>
<pre class="programlisting">const unsigned <span class="returnvalue">char</span> *
p11_kit_pin_get_value (<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="type">P11KitPin</span></a> *pin</code></em>,
<em class="parameter"><code><span class="type">size_t</span> *length</code></em>);</pre>
<p>Get the PIN value from a P11KitPin. <em class="parameter"><code>length</code></em>
will be set to the
length of the value.</p>
<p>The value returned is owned by the P11KitPin and should not be modified.
It remains valid as long as a reference to the PIN is held. The PIN value
will not contain an extra null-terminator character.</p>
<div class="refsect3">
<a name="p11-kit-pin-get-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin</p></td>
<td class="parameter_description"><p>the P11KitPin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>a location to return the value length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-get-value.returns"></a><h4>Returns</h4>
<p> the value for the PIN.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-get-length"></a><h3>p11_kit_pin_get_length ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
p11_kit_pin_get_length (<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="type">P11KitPin</span></a> *pin</code></em>);</pre>
<p>Get the length of the PIN value from a P11KitPin.</p>
<div class="refsect3">
<a name="p11-kit-pin-get-length.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>pin</p></td>
<td class="parameter_description"><p>the P11KitPin</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-get-length.returns"></a><h4>Returns</h4>
<p> the length of the PIN value.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-ref"></a><h3>p11_kit_pin_ref ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_ref (<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="type">P11KitPin</span></a> *pin</code></em>);</pre>
<p>Add a reference to a P11KitPin. This should be matched with a later call
to <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a>. As long as at least one reference is held, the PIN
will remain valid and in memory.</p>
<div class="refsect3">
<a name="p11-kit-pin-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>pin</p></td>
<td class="parameter_description"><p>the P11KitPin</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-ref.returns"></a><h4>Returns</h4>
<p> the <em class="parameter"><code>pin</code></em>
pointer, for convenience sake.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-unref"></a><h3>p11_kit_pin_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_pin_unref (<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="type">P11KitPin</span></a> *pin</code></em>);</pre>
<p>Remove a reference from a P11KitPin. When all references have been removed
then the PIN will be freed and will no longer be in memory.</p>
<div class="refsect3">
<a name="p11-kit-pin-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>pin</p></td>
<td class="parameter_description"><p>the P11KitPin</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-register-callback"></a><h3>p11_kit_pin_register_callback ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
p11_kit_pin_register_callback (<em class="parameter"><code>const <span class="type">char</span> *pin_source</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-callback" title="p11_kit_pin_callback ()"><span class="type">p11_kit_pin_callback</span></a> callback</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-destroy-func" title="p11_kit_pin_destroy_func ()"><span class="type">p11_kit_pin_destroy_func</span></a> callback_destroy</code></em>);</pre>
<p>Register a callback to handle PIN requests for a given 'pin-source' attribute.
If <em class="parameter"><code>pin_source</code></em>
is set to P11_KIT_PIN_FALLBACK then this will be a fallback
callback and will be called for requests for which no other callback has
been specifically registered.</p>
<p>If multiple callbacks are registered for the same <em class="parameter"><code>pin_source</code></em>
value, then
the last registered callback will be the first to be called.</p>
<div class="refsect3">
<a name="p11-kit-pin-register-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin_source</p></td>
<td class="parameter_description"><p>the 'pin-source' attribute this this callback is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>the callback function</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback_data</p></td>
<td class="parameter_description"><p>data that will be passed to the callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback_destroy</p></td>
<td class="parameter_description"><p>a function that will be called with <em class="parameter"><code>callback_data</code></em>
when
the callback is unregistered.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-register-callback.returns"></a><h4>Returns</h4>
<p> Returns negative if registering fails.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-unregister-callback"></a><h3>p11_kit_pin_unregister_callback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_pin_unregister_callback (<em class="parameter"><code>const <span class="type">char</span> *pin_source</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-callback" title="p11_kit_pin_callback ()"><span class="type">p11_kit_pin_callback</span></a> callback</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);</pre>
<p>Unregister a callback that was previously registered with the
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()"><code class="function">p11_kit_pin_register_callback()</code></a> function. If more than one registered
callback matches the given arguments, then only one of those will be
removed.</p>
<div class="refsect3">
<a name="p11-kit-pin-unregister-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin_source</p></td>
<td class="parameter_description"><p>the 'pin-source' attribute the callback was registered for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>the callback function that was registered</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback_data</p></td>
<td class="parameter_description"><p>data that was registered for the callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-callback"></a><h3>p11_kit_pin_callback ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
<span class="c_punctuation">(</span>*p11_kit_pin_callback<span class="c_punctuation">)</span> (<em class="parameter"><code>const <span class="type">char</span> *pin_source</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-URIs.html#P11KitUri" title="P11KitUri"><span class="type">P11KitUri</span></a> *pin_uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *pin_description</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPinFlags" title="enum P11KitPinFlags"><span class="type">P11KitPinFlags</span></a> pin_flags</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);</pre>
<p>Represents a PIN callback function.</p>
<p>The various arguments are the same as the ones passed to
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-request" title="p11_kit_pin_request ()"><code class="function">p11_kit_pin_request()</code></a>. The <em class="parameter"><code>callback_data</code></em>
argument was the one passed to
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()"><code class="function">p11_kit_pin_register_callback()</code></a> when registering this callback.</p>
<p>The function should return <code class="literal">NULL</code> if it could not provide a PIN, either
because of an error or a user cancellation.</p>
<p>If a PIN is returned, it will be unreferenced by the caller. So it should be
either newly allocated, or referenced before returning.</p>
<div class="refsect3">
<a name="p11-kit-pin-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin_source</p></td>
<td class="parameter_description"><p>a 'pin-source' attribute string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_uri</p></td>
<td class="parameter_description"><p>a PKCS#11 URI that the PIN is for, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_description</p></td>
<td class="parameter_description"><p>a descrption of what the PIN is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_flags</p></td>
<td class="parameter_description"><p>flags describing the PIN request</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback_data</p></td>
<td class="parameter_description"><p>data that was provided when registering this callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-callback.returns"></a><h4>Returns</h4>
<p> A PIN or <code class="literal">NULL</code></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-request"></a><h3>p11_kit_pin_request ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_request (<em class="parameter"><code>const <span class="type">char</span> *pin_source</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-URIs.html#P11KitUri" title="P11KitUri"><span class="type">P11KitUri</span></a> *pin_uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *pin_description</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPinFlags" title="enum P11KitPinFlags"><span class="type">P11KitPinFlags</span></a> pin_flags</code></em>);</pre>
<p>Request a PIN for a given 'pin-source' attribute. The result depends on the
registered callbacks.</p>
<p>If not <code class="literal">NULL</code>, then the <em class="parameter"><code>pin_uri</code></em>
attribute should point to the thing that the
PIN is being requested for. In most use cases this should be a PKCS#11 URI
pointing to a token.</p>
<p>The <em class="parameter"><code>pin_description</code></em>
should always be specified. It is a string describing
what the PIN is for. For example this would be the token label, if the PIN
is for a token.</p>
<p>If more than one callback is registered for the <em class="parameter"><code>pin_source</code></em>
, then the latest
registered one will be called first. If that callback does not return a
PIN, then the next will be called in turn.</p>
<p>If no callback is registered for <em class="parameter"><code>pin_source</code></em>
, then the fallback callbacks will
be invoked in the same way. The fallback callbacks will not be called if any
callback has been registered specifically for <em class="parameter"><code>pin_source</code></em>
.</p>
<p>The PIN returned should be released with <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a>.</p>
<div class="refsect3">
<a name="p11-kit-pin-request.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin_source</p></td>
<td class="parameter_description"><p>the 'pin-source' attribute that is being requested</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_uri</p></td>
<td class="parameter_description"><p>a PKCS#11 URI that the PIN is being requested for, optionally <code class="literal">NULL</code>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_description</p></td>
<td class="parameter_description"><p>a description of what the PIN is for, must not be <code class="literal">NULL</code>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_flags</p></td>
<td class="parameter_description"><p>various flags for this request</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-request.returns"></a><h4>Returns</h4>
<p> the PIN which should be released with <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()"><code class="function">p11_kit_pin_unref()</code></a>, or <code class="literal">NULL</code>
if no callback was registered or could proivde a PIN</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-destroy-func"></a><h3>p11_kit_pin_destroy_func ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*p11_kit_pin_destroy_func<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">void</span> *data</code></em>);</pre>
<p>A function called to free or cleanup <em class="parameter"><code>data</code></em>
.</p>
<div class="refsect3">
<a name="p11-kit-pin-destroy-func.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data to destroy</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-pin-file-callback"></a><h3>p11_kit_pin_file_callback ()</h3>
<pre class="programlisting"><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin"><span class="returnvalue">P11KitPin</span></a> *
p11_kit_pin_file_callback (<em class="parameter"><code>const <span class="type">char</span> *pin_source</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-URIs.html#P11KitUri" title="P11KitUri"><span class="type">P11KitUri</span></a> *pin_uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *pin_description</code></em>,
<em class="parameter"><code><a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPinFlags" title="enum P11KitPinFlags"><span class="type">P11KitPinFlags</span></a> pin_flags</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);</pre>
<p>This is a PIN callback function that looks up the 'pin-source' attribute in
a file with that name. This can be used to enable the normal PKCS#11 URI
behavior described in the RFC.</p>
<p>If <em class="parameter"><code>pin_flags</code></em>
contains the <a class="link" href="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-RETRY:CAPS"><code class="literal">P11_KIT_PIN_FLAGS_RETRY</code></a> flag, then this
callback will always return <code class="literal">NULL</code>. This is to prevent endless loops
where an application is expecting to interact with a prompter, but
instead is interacting with this callback reading a file over and over.</p>
<p>This callback fails on files larger than 4 Kilobytes.</p>
<p>This callback is not registered by default. It may have security
implications depending on the source of the PKCS#11 URI and the PKCS#11
in use. To register it, use code like the following:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">p11_kit_pin_register_callback</span><span class="w"> </span><span class="p">(</span><span class="n">P11_KIT_PIN_FALLBACK</span><span class="p">,</span><span class="w"> </span><span class="n">p11_kit_pin_file_callback</span><span class="p">,</span>
<span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<div class="refsect3">
<a name="p11-kit-pin-file-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pin_source</p></td>
<td class="parameter_description"><p>a 'pin-source' attribute string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_uri</p></td>
<td class="parameter_description"><p>a PKCS#11 URI that the PIN is for, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_description</p></td>
<td class="parameter_description"><p>a descrption of what the PIN is for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pin_flags</p></td>
<td class="parameter_description"><p>flags describing the PIN request</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback_data</p></td>
<td class="parameter_description"><p>unused, should be <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-pin-file-callback.returns"></a><h4>Returns</h4>
<p> a referenced PIN with the file contents, or <code class="literal">NULL</code> if the file
could not be read</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="p11-kit-PIN-Callbacks.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="P11KitPin"></a><h3>P11KitPin</h3>
<p>A structure representing a PKCS#11 PIN. There are no public fields
visible in this structure. Use the various accessor functions.</p>
</div>
<hr>
<div class="refsect2">
<a name="P11KitPinFlags"></a><h3>enum P11KitPinFlags</h3>
<p>Flags that are passed to <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-request" title="p11_kit_pin_request ()"><code class="function">p11_kit_pin_request()</code></a> and registered callbacks.</p>
<div class="refsect3">
<a name="P11KitPinFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-USER-LOGIN:CAPS"></a>P11_KIT_PIN_FLAGS_USER_LOGIN</p></td>
<td class="enum_member_description">
<p>The PIN is for a PKCS#11 user type login.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-SO-LOGIN:CAPS"></a>P11_KIT_PIN_FLAGS_SO_LOGIN</p></td>
<td class="enum_member_description">
<p>The PIN is for a PKCS#11 security officer type login.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-CONTEXT-LOGIN:CAPS"></a>P11_KIT_PIN_FLAGS_CONTEXT_LOGIN</p></td>
<td class="enum_member_description">
<p>The PIN is for a PKCS#11 contect specific type login.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-RETRY:CAPS"></a>P11_KIT_PIN_FLAGS_RETRY</p></td>
<td class="enum_member_description">
<p>The PIN is being requested again, due to an invalid previous PIN.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-MANY-TRIES:CAPS"></a>P11_KIT_PIN_FLAGS_MANY_TRIES</p></td>
<td class="enum_member_description">
<p>The PIN has failed too many times, and few tries are left.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="P11-KIT-PIN-FLAGS-FINAL-TRY:CAPS"></a>P11_KIT_PIN_FLAGS_FINAL_TRY</p></td>
<td class="enum_member_description">
<p>The PIN has failed too many times, and this is the last try.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="P11-KIT-PIN-FALLBACK:CAPS"></a><h3>P11_KIT_PIN_FALLBACK</h3>
<pre class="programlisting">#define P11_KIT_PIN_FALLBACK</pre>
<p>Used with <a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()"><code class="function">p11_kit_pin_register_callback()</code></a> to register a fallback callback.
This callback will be called if no other callback is registered for a 'pin-source'.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,269 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utilities: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">
<link rel="next" href="p11-kit-Future.html" title="Future">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#p11-kit-Utilities.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="p11-kit-PIN-Callbacks.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="p11-kit-Future.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="p11-kit-Utilities"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="p11-kit-Utilities.top_of_page"></a>Utilities</span></h2>
<p>Utilities — PKCS#11 utilities</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="p11-kit-Utilities.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-strerror" title="p11_kit_strerror ()">p11_kit_strerror</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-message" title="p11_kit_message ()">p11_kit_message</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-space-strdup" title="p11_kit_space_strdup ()">p11_kit_space_strdup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-space-strlen" title="p11_kit_space_strlen ()">p11_kit_space_strlen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-be-quiet" title="p11_kit_be_quiet ()">p11_kit_be_quiet</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="p11-kit-Utilities.html#p11-kit-be-loud" title="p11_kit_be_loud ()">p11_kit_be_loud</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-Utilities.description"></a><h2>Description</h2>
<p>Utility functions for working with PKCS#11.</p>
</div>
<div class="refsect1">
<a name="p11-kit-Utilities.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="p11-kit-strerror"></a><h3>p11_kit_strerror ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
p11_kit_strerror (<em class="parameter"><code><span class="type">CK_RV</span> rv</code></em>);</pre>
<p>Get a message for a PKCS#11 return value or error code. Do not
pass CKR_OK or other such non errors to this function.</p>
<div class="refsect3">
<a name="p11-kit-strerror.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>rv</p></td>
<td class="parameter_description"><p>The code to get a message for.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-strerror.returns"></a><h4>Returns</h4>
<p> The user readable and localized message.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-message"></a><h3>p11_kit_message ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
p11_kit_message (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Gets the failure message for a recently called p11-kit function, which
returned a failure code on this thread. Not all functions set this message.
Each function that does so, will note it in its documentation.</p>
<p>If the most recent p11-kit function did not fail, then this will return NULL.
The string is owned by the p11-kit library and is only valid on the same
thread that the failed function executed on.</p>
<div class="refsect3">
<a name="p11-kit-message.returns"></a><h4>Returns</h4>
<p> The last failure message, or <code class="literal">NULL</code>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-space-strdup"></a><h3>p11_kit_space_strdup ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
p11_kit_space_strdup (<em class="parameter"><code>const unsigned <span class="type">char</span> *string</code></em>,
<em class="parameter"><code><span class="type">size_t</span> max_length</code></em>);</pre>
<p>In PKCS#11 structures many strings are encoded in a strange way. The string
is placed in a fixed length buffer and then padded with spaces.</p>
<p>This function copies the space padded string into a normal null-terminated
string. The result is owned by the caller.</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">CK_INFO</span><span class="w"> </span><span class="n">info</span><span class="p">;</span>
<span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">description</span><span class="p">;</span>
<span class="w"> </span><span class="p">...</span>
<span class="n">description</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">p11_kit_space_strdup</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">libraryDescription</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">libraryDescription</span><span class="p">));</span></pre></td>
</tr>
</tbody>
</table>
</div>
<div class="refsect3">
<a name="p11-kit-space-strdup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>Pointer to string block</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_length</p></td>
<td class="parameter_description"><p>Maximum length of string block</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-space-strdup.returns"></a><h4>Returns</h4>
<p> The newly allocated string, or <code class="literal">NULL</code> if memory could not be allocated.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-space-strlen"></a><h3>p11_kit_space_strlen ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
p11_kit_space_strlen (<em class="parameter"><code>const unsigned <span class="type">char</span> *string</code></em>,
<em class="parameter"><code><span class="type">size_t</span> max_length</code></em>);</pre>
<p>In PKCS#11 structures many strings are encoded in a strange way. The string
is placed in a fixed length buffer and then padded with spaces.</p>
<p>This function determines the actual length of the string. Since the string
is not null-terminated you need to pass in the size of buffer as max_length.
The string will never be longer than this buffer.</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">CK_INFO</span><span class="w"> </span><span class="n">info</span><span class="p">;</span>
<span class="kt">size_t</span><span class="w"> </span><span class="n">length</span><span class="p">;</span>
<span class="w"> </span><span class="p">...</span>
<span class="n">length</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">p11_kit_space_strlen</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">libraryDescription</span><span class="p">,</span><span class="w"> </span><span class="k">sizeof</span><span class="w"> </span><span class="p">(</span><span class="n">info</span><span class="o">-&gt;</span><span class="n">libraryDescription</span><span class="p">));</span></pre></td>
</tr>
</tbody>
</table>
</div>
<div class="refsect3">
<a name="p11-kit-space-strlen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>Pointer to string block</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_length</p></td>
<td class="parameter_description"><p>Maximum length of string block</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="p11-kit-space-strlen.returns"></a><h4>Returns</h4>
<p> The length of the space padded string.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-be-quiet"></a><h3>p11_kit_be_quiet ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_be_quiet (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Once this function is called, the p11-kit library will no longer print
failure or warning messages to stderr.</p>
</div>
<hr>
<div class="refsect2">
<a name="p11-kit-be-loud"></a><h3>p11_kit_be_loud ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
p11_kit_be_loud (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Tell the p11-kit library will print failure or warning messages to stderr.
This is the default behavior, but can be changed using <a class="link" href="p11-kit-Utilities.html#p11-kit-be-quiet" title="p11_kit_be_quiet ()"><code class="function">p11_kit_be_quiet()</code></a>.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<book xmlns="http://www.devhelp.net/book" title="p11-kit" link="index.html" author="" name="p11-kit" version="2" language="c">
<chapters>
<sub name="PKCS#11 Configuration" link="config.html">
<sub name="Consistent configuration" link="config.html#config-introduction"/>
<sub name="Example" link="config-example.html"/>
<sub name="Configuration Files" link="config-files.html"/>
</sub>
<sub name="Sharing PKCS#11 modules" link="sharing.html">
<sub name="Multiple consumers of PKCS#11 in a process" link="sharing.html#sharing-problem"/>
<sub name="Managed modules" link="sharing-managed.html"/>
</sub>
<sub name="Proxy Module" link="sharing.html"/>
<sub name="Remoting / Forwarding" link="remoting.html"/>
<sub name="Trust Policy Module" link="trust-module.html">
<sub name="Paths loaded by the Module" link="trust-module.html#trust-files"/>
<sub name="Using the Trust Policy Module with NSS" link="trust-nss.html"/>
<sub name="Using the Trust Policy Module with glib-networking" link="trust-glib-networking.html"/>
<sub name="Disabling the Trust Policy Module" link="trust-disable.html"/>
</sub>
<sub name="Manual Pages" link="tools.html">
<sub name="p11-kit" link="p11-kit.html"/>
<sub name="pkcs11.conf" link="pkcs11-conf.html"/>
<sub name="trust" link="trust.html"/>
</sub>
<sub name="API Reference" link="reference.html">
<sub name="Modules" link="p11-kit-Modules.html"/>
<sub name="URIs" link="p11-kit-URIs.html"/>
<sub name="PIN Callbacks" link="p11-kit-PIN-Callbacks.html"/>
<sub name="Utilities" link="p11-kit-Utilities.html"/>
<sub name="Future" link="p11-kit-Future.html"/>
<sub name="Deprecated" link="p11-kit-Deprecated.html"/>
<sub name="API Index" link="reference.html#api-index-full"/>
<sub name="Annotation Glossary" link="reference.html#annotation-glossary"/>
</sub>
<sub name="Building, Packaging, and Contributing to p11-kit" link="devel.html">
<sub name="Helpful Resources" link="devel.html#devel-links"/>
<sub name="Packaging PKCS#11 module configs" link="devel-paths.html">
<sub name="Path to place module configuration" link="devel-paths.html#devel-paths-config"/>
<sub name="Default path for modules with relative paths" link="devel-paths.html#devel-paths-modules"/>
</sub>
<sub name="Customizing installed commands" link="devel-commands.html"/>
<sub name="Compiling p11-kit from Source" link="devel-building.html">
<sub name="Building on UNIX" link="devel-building.html#devel-building-unix"/>
<sub name="Optional Dependencies" link="devel-building.html#devel-building-dependencies"/>
<sub name="Extra Configuration Options" link="devel-building.html#devel-building-configure"/>
</sub>
<sub name="Coding Style" link="devel-building-style.html"/>
<sub name="Testing and Code Coverage" link="devel-testing.html"/>
<sub name="Debugging Tips" link="devel-debugging.html"/>
</sub>
</chapters>
<functions>
<keyword type="function" name="p11_kit_modules_load_and_initialize ()" link="p11-kit-Modules.html#p11-kit-modules-load-and-initialize"/>
<keyword type="function" name="p11_kit_modules_finalize_and_release ()" link="p11-kit-Modules.html#p11-kit-modules-finalize-and-release"/>
<keyword type="function" name="p11_kit_modules_load ()" link="p11-kit-Modules.html#p11-kit-modules-load"/>
<keyword type="function" name="p11_kit_modules_initialize ()" link="p11-kit-Modules.html#p11-kit-modules-initialize"/>
<keyword type="function" name="p11_kit_modules_finalize ()" link="p11-kit-Modules.html#p11-kit-modules-finalize"/>
<keyword type="function" name="p11_kit_modules_release ()" link="p11-kit-Modules.html#p11-kit-modules-release"/>
<keyword type="function" name="p11_kit_module_load ()" link="p11-kit-Modules.html#p11-kit-module-load"/>
<keyword type="function" name="p11_kit_module_initialize ()" link="p11-kit-Modules.html#p11-kit-module-initialize"/>
<keyword type="function" name="p11_kit_module_finalize ()" link="p11-kit-Modules.html#p11-kit-module-finalize"/>
<keyword type="function" name="p11_kit_module_release ()" link="p11-kit-Modules.html#p11-kit-module-release"/>
<keyword type="function" name="p11_kit_module_for_name ()" link="p11-kit-Modules.html#p11-kit-module-for-name"/>
<keyword type="function" name="p11_kit_module_get_name ()" link="p11-kit-Modules.html#p11-kit-module-get-name"/>
<keyword type="function" name="p11_kit_module_get_flags ()" link="p11-kit-Modules.html#p11-kit-module-get-flags"/>
<keyword type="function" name="p11_kit_module_get_filename ()" link="p11-kit-Modules.html#p11-kit-module-get-filename"/>
<keyword type="function" name="p11_kit_config_option ()" link="p11-kit-Modules.html#p11-kit-config-option"/>
<keyword type="macro" name="P11_KIT_MODULE_CRITICAL" link="p11-kit-Modules.html#P11-KIT-MODULE-CRITICAL:CAPS"/>
<keyword type="macro" name="P11_KIT_MODULE_UNMANAGED" link="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS"/>
<keyword type="function" name="p11_kit_uri_new ()" link="p11-kit-URIs.html#p11-kit-uri-new"/>
<keyword type="function" name="p11_kit_uri_get_module_info ()" link="p11-kit-URIs.html#p11-kit-uri-get-module-info"/>
<keyword type="function" name="p11_kit_uri_match_module_info ()" link="p11-kit-URIs.html#p11-kit-uri-match-module-info"/>
<keyword type="function" name="p11_kit_uri_get_slot_info ()" link="p11-kit-URIs.html#p11-kit-uri-get-slot-info"/>
<keyword type="function" name="p11_kit_uri_match_slot_info ()" link="p11-kit-URIs.html#p11-kit-uri-match-slot-info"/>
<keyword type="function" name="p11_kit_uri_get_slot_id ()" link="p11-kit-URIs.html#p11-kit-uri-get-slot-id"/>
<keyword type="function" name="p11_kit_uri_set_slot_id ()" link="p11-kit-URIs.html#p11-kit-uri-set-slot-id"/>
<keyword type="function" name="p11_kit_uri_get_token_info ()" link="p11-kit-URIs.html#p11-kit-uri-get-token-info"/>
<keyword type="function" name="p11_kit_uri_match_token_info ()" link="p11-kit-URIs.html#p11-kit-uri-match-token-info"/>
<keyword type="function" name="p11_kit_uri_get_attributes ()" link="p11-kit-URIs.html#p11-kit-uri-get-attributes"/>
<keyword type="function" name="p11_kit_uri_set_attributes ()" link="p11-kit-URIs.html#p11-kit-uri-set-attributes"/>
<keyword type="function" name="p11_kit_uri_clear_attributes ()" link="p11-kit-URIs.html#p11-kit-uri-clear-attributes"/>
<keyword type="function" name="p11_kit_uri_match_attributes ()" link="p11-kit-URIs.html#p11-kit-uri-match-attributes"/>
<keyword type="function" name="p11_kit_uri_get_attribute ()" link="p11-kit-URIs.html#p11-kit-uri-get-attribute"/>
<keyword type="function" name="p11_kit_uri_set_attribute ()" link="p11-kit-URIs.html#p11-kit-uri-set-attribute"/>
<keyword type="function" name="p11_kit_uri_clear_attribute ()" link="p11-kit-URIs.html#p11-kit-uri-clear-attribute"/>
<keyword type="function" name="p11_kit_uri_set_unrecognized ()" link="p11-kit-URIs.html#p11-kit-uri-set-unrecognized"/>
<keyword type="function" name="p11_kit_uri_any_unrecognized ()" link="p11-kit-URIs.html#p11-kit-uri-any-unrecognized"/>
<keyword type="function" name="p11_kit_uri_get_pin_value ()" link="p11-kit-URIs.html#p11-kit-uri-get-pin-value"/>
<keyword type="function" name="p11_kit_uri_set_pin_value ()" link="p11-kit-URIs.html#p11-kit-uri-set-pin-value"/>
<keyword type="function" name="p11_kit_uri_get_pin_source ()" link="p11-kit-URIs.html#p11-kit-uri-get-pin-source"/>
<keyword type="function" name="p11_kit_uri_set_pin_source ()" link="p11-kit-URIs.html#p11-kit-uri-set-pin-source"/>
<keyword type="function" name="p11_kit_uri_get_pinfile ()" link="p11-kit-URIs.html#p11-kit-uri-get-pinfile" deprecated="use p11_kit_uri_get_pin_source()."/>
<keyword type="function" name="p11_kit_uri_set_pinfile ()" link="p11-kit-URIs.html#p11-kit-uri-set-pinfile" deprecated="use p11_kit_uri_set_pin_source()."/>
<keyword type="function" name="p11_kit_uri_get_module_name ()" link="p11-kit-URIs.html#p11-kit-uri-get-module-name"/>
<keyword type="function" name="p11_kit_uri_set_module_name ()" link="p11-kit-URIs.html#p11-kit-uri-set-module-name"/>
<keyword type="function" name="p11_kit_uri_get_module_path ()" link="p11-kit-URIs.html#p11-kit-uri-get-module-path"/>
<keyword type="function" name="p11_kit_uri_set_module_path ()" link="p11-kit-URIs.html#p11-kit-uri-set-module-path"/>
<keyword type="function" name="p11_kit_uri_get_vendor_query ()" link="p11-kit-URIs.html#p11-kit-uri-get-vendor-query"/>
<keyword type="function" name="p11_kit_uri_set_vendor_query ()" link="p11-kit-URIs.html#p11-kit-uri-set-vendor-query"/>
<keyword type="function" name="p11_kit_uri_format ()" link="p11-kit-URIs.html#p11-kit-uri-format"/>
<keyword type="function" name="p11_kit_uri_parse ()" link="p11-kit-URIs.html#p11-kit-uri-parse"/>
<keyword type="function" name="p11_kit_uri_free ()" link="p11-kit-URIs.html#p11-kit-uri-free"/>
<keyword type="function" name="p11_kit_uri_message ()" link="p11-kit-URIs.html#p11-kit-uri-message"/>
<keyword type="macro" name="P11_KIT_URI_SCHEME" link="p11-kit-URIs.html#P11-KIT-URI-SCHEME:CAPS"/>
<keyword type="macro" name="P11_KIT_URI_SCHEME_LEN" link="p11-kit-URIs.html#P11-KIT-URI-SCHEME-LEN:CAPS"/>
<keyword type="enum" name="enum P11KitUriType" link="p11-kit-URIs.html#P11KitUriType"/>
<keyword type="enum" name="enum P11KitUriResult" link="p11-kit-URIs.html#P11KitUriResult"/>
<keyword type="typedef" name="P11KitUri" link="p11-kit-URIs.html#P11KitUri"/>
<keyword type="typedef" name="p11_kit_uri" link="p11-kit-URIs.html#p11-kit-uri"/>
<keyword type="macro" name="P11_KIT_URI_NO_MEMORY" link="p11-kit-URIs.html#P11-KIT-URI-NO-MEMORY:CAPS"/>
<keyword type="function" name="p11_kit_pin_new ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-new"/>
<keyword type="function" name="p11_kit_pin_new_for_buffer ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-buffer"/>
<keyword type="function" name="p11_kit_pin_new_for_string ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-string"/>
<keyword type="function" name="p11_kit_pin_get_value ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-value"/>
<keyword type="function" name="p11_kit_pin_get_length ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-length"/>
<keyword type="function" name="p11_kit_pin_ref ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-ref"/>
<keyword type="function" name="p11_kit_pin_unref ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref"/>
<keyword type="function" name="p11_kit_pin_register_callback ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback"/>
<keyword type="function" name="p11_kit_pin_unregister_callback ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-unregister-callback"/>
<keyword type="function" name="p11_kit_pin_callback ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-callback"/>
<keyword type="function" name="p11_kit_pin_request ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-request"/>
<keyword type="function" name="p11_kit_pin_destroy_func ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-destroy-func"/>
<keyword type="function" name="p11_kit_pin_file_callback ()" link="p11-kit-PIN-Callbacks.html#p11-kit-pin-file-callback"/>
<keyword type="typedef" name="P11KitPin" link="p11-kit-PIN-Callbacks.html#P11KitPin"/>
<keyword type="enum" name="enum P11KitPinFlags" link="p11-kit-PIN-Callbacks.html#P11KitPinFlags"/>
<keyword type="macro" name="P11_KIT_PIN_FALLBACK" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FALLBACK:CAPS"/>
<keyword type="function" name="p11_kit_strerror ()" link="p11-kit-Utilities.html#p11-kit-strerror"/>
<keyword type="function" name="p11_kit_message ()" link="p11-kit-Utilities.html#p11-kit-message"/>
<keyword type="function" name="p11_kit_space_strdup ()" link="p11-kit-Utilities.html#p11-kit-space-strdup"/>
<keyword type="function" name="p11_kit_space_strlen ()" link="p11-kit-Utilities.html#p11-kit-space-strlen"/>
<keyword type="function" name="p11_kit_be_quiet ()" link="p11-kit-Utilities.html#p11-kit-be-quiet"/>
<keyword type="function" name="p11_kit_be_loud ()" link="p11-kit-Utilities.html#p11-kit-be-loud"/>
<keyword type="function" name="p11_kit_set_progname ()" link="p11-kit-Future.html#p11-kit-set-progname"/>
<keyword type="function" name="p11_kit_destroyer ()" link="p11-kit-Future.html#p11-kit-destroyer"/>
<keyword type="function" name="p11_kit_iter_new ()" link="p11-kit-Future.html#p11-kit-iter-new"/>
<keyword type="function" name="p11_kit_iter_set_uri ()" link="p11-kit-Future.html#p11-kit-iter-set-uri"/>
<keyword type="function" name="p11_kit_iter_add_callback ()" link="p11-kit-Future.html#p11-kit-iter-add-callback"/>
<keyword type="function" name="p11_kit_iter_add_filter ()" link="p11-kit-Future.html#p11-kit-iter-add-filter"/>
<keyword type="function" name="p11_kit_iter_callback ()" link="p11-kit-Future.html#p11-kit-iter-callback"/>
<keyword type="function" name="p11_kit_iter_begin ()" link="p11-kit-Future.html#p11-kit-iter-begin"/>
<keyword type="function" name="p11_kit_iter_begin_with ()" link="p11-kit-Future.html#p11-kit-iter-begin-with"/>
<keyword type="function" name="p11_kit_iter_next ()" link="p11-kit-Future.html#p11-kit-iter-next"/>
<keyword type="function" name="p11_kit_iter_get_kind ()" link="p11-kit-Future.html#p11-kit-iter-get-kind"/>
<keyword type="function" name="p11_kit_iter_get_module ()" link="p11-kit-Future.html#p11-kit-iter-get-module"/>
<keyword type="function" name="p11_kit_iter_get_slot ()" link="p11-kit-Future.html#p11-kit-iter-get-slot"/>
<keyword type="function" name="p11_kit_iter_get_slot_info ()" link="p11-kit-Future.html#p11-kit-iter-get-slot-info"/>
<keyword type="function" name="p11_kit_iter_get_token ()" link="p11-kit-Future.html#p11-kit-iter-get-token"/>
<keyword type="function" name="p11_kit_iter_get_session ()" link="p11-kit-Future.html#p11-kit-iter-get-session"/>
<keyword type="function" name="p11_kit_iter_keep_session ()" link="p11-kit-Future.html#p11-kit-iter-keep-session"/>
<keyword type="function" name="p11_kit_iter_get_object ()" link="p11-kit-Future.html#p11-kit-iter-get-object"/>
<keyword type="function" name="p11_kit_iter_get_attributes ()" link="p11-kit-Future.html#p11-kit-iter-get-attributes"/>
<keyword type="function" name="p11_kit_iter_load_attributes ()" link="p11-kit-Future.html#p11-kit-iter-load-attributes"/>
<keyword type="function" name="p11_kit_iter_destroy_object ()" link="p11-kit-Future.html#p11-kit-iter-destroy-object"/>
<keyword type="function" name="p11_kit_iter_free ()" link="p11-kit-Future.html#p11-kit-iter-free"/>
<keyword type="function" name="p11_kit_remote_serve_module ()" link="p11-kit-Future.html#p11-kit-remote-serve-module"/>
<keyword type="function" name="p11_kit_remote_serve_token ()" link="p11-kit-Future.html#p11-kit-remote-serve-token" deprecated="use p11_kit_remote_serve_tokens()"/>
<keyword type="function" name="p11_kit_remote_serve_tokens ()" link="p11-kit-Future.html#p11-kit-remote-serve-tokens"/>
<keyword type="typedef" name="P11KitIter" link="p11-kit-Future.html#P11KitIter"/>
<keyword type="typedef" name="p11_kit_iter" link="p11-kit-Future.html#p11-kit-iter"/>
<keyword type="enum" name="enum P11KitIterKind" link="p11-kit-Future.html#P11KitIterKind"/>
<keyword type="enum" name="enum P11KitIterBehavior" link="p11-kit-Future.html#P11KitIterBehavior"/>
<keyword type="function" name="p11_kit_initialize_registered ()" link="p11-kit-Deprecated.html#p11-kit-initialize-registered" deprecated="Since: 0.19.0: Use p11_kit_modules_load() instead."/>
<keyword type="function" name="p11_kit_finalize_registered ()" link="p11-kit-Deprecated.html#p11-kit-finalize-registered" deprecated="Since 0.19.0: Use p11_kit_modules_release() instead."/>
<keyword type="function" name="p11_kit_registered_modules ()" link="p11-kit-Deprecated.html#p11-kit-registered-modules" deprecated="Since 0.19.0: Use p11_kit_modules_load() instead."/>
<keyword type="function" name="p11_kit_registered_module_to_name ()" link="p11-kit-Deprecated.html#p11-kit-registered-module-to-name" deprecated="Since 0.19.0: Use p11_kit_module_get_name() instead."/>
<keyword type="function" name="p11_kit_registered_name_to_module ()" link="p11-kit-Deprecated.html#p11-kit-registered-name-to-module" deprecated="Since 0.19.0: Use p11_kit_module_for_name() instead."/>
<keyword type="function" name="p11_kit_registered_option ()" link="p11-kit-Deprecated.html#p11-kit-registered-option" deprecated="Since 0.19.0: Use p11_kit_config_option() instead."/>
<keyword type="function" name="p11_kit_initialize_module ()" link="p11-kit-Deprecated.html#p11-kit-initialize-module" deprecated="Since 0.19.0: Use p11_kit_module_initialize() instead."/>
<keyword type="function" name="p11_kit_load_initialize_module ()" link="p11-kit-Deprecated.html#p11-kit-load-initialize-module" deprecated="Since 0.19.0: Use p11_kit_module_load() instead."/>
<keyword type="function" name="p11_kit_finalize_module ()" link="p11-kit-Deprecated.html#p11-kit-finalize-module" deprecated=""/>
<keyword type="macro" name="P11_KIT_DEPRECATED_FOR()" link="p11-kit-Deprecated.html#P11-KIT-DEPRECATED-FOR:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_OBJECT" link="p11-kit-URIs.html#P11-KIT-URI-FOR-OBJECT:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_TOKEN" link="p11-kit-URIs.html#P11-KIT-URI-FOR-TOKEN:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_SLOT" link="p11-kit-URIs.html#P11-KIT-URI-FOR-SLOT:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_MODULE" link="p11-kit-URIs.html#P11-KIT-URI-FOR-MODULE:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_MODULE_WITH_VERSION" link="p11-kit-URIs.html#P11-KIT-URI-FOR-MODULE-WITH-VERSION:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_OBJECT_ON_TOKEN" link="p11-kit-URIs.html#P11-KIT-URI-FOR-OBJECT-ON-TOKEN:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE" link="p11-kit-URIs.html#P11-KIT-URI-FOR-OBJECT-ON-TOKEN-AND-MODULE:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_FOR_ANY" link="p11-kit-URIs.html#P11-KIT-URI-FOR-ANY:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_OK" link="p11-kit-URIs.html#P11-KIT-URI-OK:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_UNEXPECTED" link="p11-kit-URIs.html#P11-KIT-URI-UNEXPECTED:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_BAD_SCHEME" link="p11-kit-URIs.html#P11-KIT-URI-BAD-SCHEME:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_BAD_ENCODING" link="p11-kit-URIs.html#P11-KIT-URI-BAD-ENCODING:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_BAD_SYNTAX" link="p11-kit-URIs.html#P11-KIT-URI-BAD-SYNTAX:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_BAD_VERSION" link="p11-kit-URIs.html#P11-KIT-URI-BAD-VERSION:CAPS"/>
<keyword type="constant" name="P11_KIT_URI_NOT_FOUND" link="p11-kit-URIs.html#P11-KIT-URI-NOT-FOUND:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_USER_LOGIN" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-USER-LOGIN:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_SO_LOGIN" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-SO-LOGIN:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_CONTEXT_LOGIN" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-CONTEXT-LOGIN:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_RETRY" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-RETRY:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_MANY_TRIES" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-MANY-TRIES:CAPS"/>
<keyword type="constant" name="P11_KIT_PIN_FLAGS_FINAL_TRY" link="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FLAGS-FINAL-TRY:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_MODULE" link="p11-kit-Future.html#P11-KIT-ITER-KIND-MODULE:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_SLOT" link="p11-kit-Future.html#P11-KIT-ITER-KIND-SLOT:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_TOKEN" link="p11-kit-Future.html#P11-KIT-ITER-KIND-TOKEN:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_OBJECT" link="p11-kit-Future.html#P11-KIT-ITER-KIND-OBJECT:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_SESSION" link="p11-kit-Future.html#P11-KIT-ITER-KIND-SESSION:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_KIND_UNKNOWN" link="p11-kit-Future.html#P11-KIT-ITER-KIND-UNKNOWN:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_BUSY_SESSIONS" link="p11-kit-Future.html#P11-KIT-ITER-BUSY-SESSIONS:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WANT_WRITABLE" link="p11-kit-Future.html#P11-KIT-ITER-WANT-WRITABLE:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITH_MODULES" link="p11-kit-Future.html#P11-KIT-ITER-WITH-MODULES:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITH_SLOTS" link="p11-kit-Future.html#P11-KIT-ITER-WITH-SLOTS:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITH_TOKENS" link="p11-kit-Future.html#P11-KIT-ITER-WITH-TOKENS:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITHOUT_OBJECTS" link="p11-kit-Future.html#P11-KIT-ITER-WITHOUT-OBJECTS:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITH_LOGIN" link="p11-kit-Future.html#P11-KIT-ITER-WITH-LOGIN:CAPS"/>
<keyword type="constant" name="P11_KIT_ITER_WITH_SESSIONS" link="p11-kit-Future.html#P11-KIT-ITER-WITH-SESSIONS:CAPS"/>
</functions>
</book>

View File

@@ -0,0 +1,516 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>p11-kit: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="tools.html" title="Manual Pages">
<link rel="prev" href="tools.html" title="Manual Pages">
<link rel="next" href="pkcs11-conf.html" title="pkcs11.conf">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="tools.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="tools.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="pkcs11-conf.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="p11-kit"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">p11-kit</span></h2>
<p>p11-kit — Tool for operating on configured PKCS#11 modules</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p><code class="command">p11-kit list-modules</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit list-tokens ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit list-objects ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit import-object ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit export-object ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit delete-object ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit generate-keypair ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit list-profiles ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit add-profile ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit delete-profile ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit list-mechanisms ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit print-config</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit extract ...</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">p11-kit server ...</code> </p></div>
</div>
<div class="refsect1">
<a name="p11-kit-description"></a><h2>Description</h2>
<p><span class="command"><strong>p11-kit</strong></span> is a command line tool that
can be used to perform operations on PKCS#11 modules configured on the
system.</p>
<p>See the various sub commands below. The following global options
can be used:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">-v, --verbose</code></span></p></td>
<td><p>Run in verbose mode with debug
output.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">-q, --quiet</code></span></p></td>
<td><p>Run in quiet mode without warning or
failure messages.</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-list-modules"></a><h2>List Modules</h2>
<p>List system configured PKCS#11 modules.</p>
<pre class="programlisting">
$ p11-kit list-modules
</pre>
<p>The modules, information about them and the tokens present in
the PKCS#11 modules will be displayed.</p>
</div>
<div class="refsect1">
<a name="p11-kit-list-tokens"></a><h2>List Tokens</h2>
<p>List all tokens available in system configured PKCS#11 modules.</p>
<pre class="programlisting">
$ p11-kit list-tokens pkcs11:token
</pre>
<p>This retrieves all tokens and displays some of their
common attributes.</p>
<p>This subcommand takes the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--only-uris</code></span></p></td>
<td><p>Print only the matching token URIs.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-list-objects"></a><h2>List Objects</h2>
<p>List objects matching given PKCS#11 URI.</p>
<pre class="programlisting">
$ p11-kit list-objects pkcs11:object_on_token
</pre>
<p>This retrieves all objects that match given PKCS#11 URI and displays
some of their common attributes. Storage objects also have their PKCS#11 URI
displayed.</p>
<p>This subcommand takes the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-import-object"></a><h2>Import Object</h2>
<p>Import object into PKCS#11 token.</p>
<pre class="programlisting">
$ p11-kit import-object --file=file.pem [--label=label] [--id=object_id] pkcs11:token
</pre>
<p>Takes either an X.509 certificate or a public key in the form of a PEM file
and imports it into the first token matched by given PKCS#11 URI.</p>
<p>The following options are required:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="option">--file=&lt;file.pem&gt;</code></span></p></td>
<td><p>File containing either an X.509 certificate
or a public key in PEM format.</p></td>
</tr></tbody>
</table></div>
<p>This subcommand also accepts the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--label=&lt;label&gt;</code></span></p></td>
<td><p>Assigns label to the imported object.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--id=&lt;object_id&gt;</code></span></p></td>
<td><p>Assigns ID to the imported object. The ID should be specified in hexadecimal format without '0x' prefix.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-export-object"></a><h2>Export Object</h2>
<p>Export object matching PKCS#11 URI.</p>
<pre class="programlisting">
$ p11-kit export-object pkcs11:object_on_token
</pre>
<p>Displays PEM formatted contents of the first object matched by given PKCS#11 URI.
The matched object has to either be an X.509 certificate or a public key.</p>
<p>This subcommand takes the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-delete-object"></a><h2>Delete Object</h2>
<p>Delete object matching PKCS#11 URI.</p>
<pre class="programlisting">
$ p11-kit delete-object pkcs11:object_on_token
</pre>
<p>Destroys the first object matched by given PKCS#11 URI.</p>
<p>This subcommand takes the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-generate-keypair"></a><h2>Generate Key-pair</h2>
<p>Generate key-pair on a PKCS#11 token.</p>
<pre class="programlisting">
$ p11-kit generate-keypair --type=algorithm {--bits=n|--curve=name} [--label=label] [--id=object_id] pkcs11:token
</pre>
<p>Generate private-public key-pair of given type on the first
token matched by given PKCS#11 URI. This command should be used
together with --type option and one of --bits or --curve options.</p>
<p>The following options are required:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--type=&lt;algorithm&gt;</code></span></p></td>
<td><p>Specify the type of keys to generate.
Supported values are rsa, ecdsa and eddsa.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--bits=&lt;n&gt;</code></span></p></td>
<td><p>Specify the number of bits for the key-pair generation.
Cannot be used together with --curve option.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--curve=&lt;name&gt;</code></span></p></td>
<td><p>Specify an elliptic curve for the key-pair generation.
Supported values are secp256r1, secp384r1, secp521r1, ed25519 and ed448.
Cannot be used together with --bits option.</p></td>
</tr>
</tbody>
</table></div>
<p>This subcommand also accepts the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--label=&lt;label&gt;</code></span></p></td>
<td><p>Assigns label to the generated key-pair objects.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--id=&lt;object_id&gt;</code></span></p></td>
<td><p>Assigns ID to the generated key-pair objects. The ID should be specified in hexadecimal format without '0x' prefix.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-list-profiles"></a><h2>List Profiles</h2>
<p>List PKCS#11 profiles supported by the token.</p>
<pre class="programlisting">
$ p11-kit list-profiles pkcs11:token
</pre>
<p>Displays profile IDs of the first token matched by given
PKCS#11 URI in human-readable form.</p>
<p>This subcommand takes the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-add-profile"></a><h2>Add Profile</h2>
<p>Add PKCS#11 profile to a token.</p>
<pre class="programlisting">
$ p11-kit add-profile --profile=profile pkcs11:token
</pre>
<p>Creates new profile object with given profile ID on the
first token matched by given PKCS#11 URI. This command fails
if the profile ID already exists on the token.</p>
<p>The following options are required:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="option">--profile=&lt;profile&gt;</code></span></p></td>
<td><p>Profile ID to add. Value can either
be numerical or textual.</p></td>
</tr></tbody>
</table></div>
<p>This subcommand also accepts the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-delete-profile"></a><h2>Delete Profile</h2>
<p>Delete PKCS#11 profile from a token.</p>
<pre class="programlisting">
$ p11-kit delete-profile --profile=profile pkcs11:token
</pre>
<p>Destroys all profile objects with given profile ID from
the first token matched by given PKCS#11 URI.</p>
<p>The following options are required:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="option">--profile=&lt;profile&gt;</code></span></p></td>
<td><p>Profile ID to delete. Value can either
be numerical or textual.</p></td>
</tr></tbody>
</table></div>
<p>This subcommand also accepts the following options:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--login</code></span></p></td>
<td><p>Authenticate to the token before enumerating objects. The PIN value is read from either the <code class="literal">pin-value</code> attribute in the URI or from the terminal.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--provider=&lt;module_path&gt;</code></span></p></td>
<td>
<p>Load only the given PKCS#11 module instead of enumerating modules installed on the system. If <em class="parameter"><code>module_path</code></em> is a relative path, the module is loaded from the default module path. This path can be determined by running:</p>
<pre class="programlisting">
$ <span class="command"><strong>pkg-config p11-kit-1 --variable p11_module_path</strong></span>
/usr/lib64/pkcs11</pre>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="p11-kit-list-mechanisms"></a><h2>List Mechanisms</h2>
<p>List PKCS#11 mechanisms supported by the token.</p>
<pre class="programlisting">
$ p11-kit list-mechanisms pkcs11:token
</pre>
<p>This lists all available mechanimsms for a PKCS#11 token</p>
</div>
<div class="refsect1">
<a name="p11-kit-print-config"></a><h2>Print Config</h2>
<p>Print merged configuration.</p>
<pre class="programlisting">
$ p11-kit print-config
</pre>
<p>P11-kit provides 3 levels of configuration: system wide, per-module, and per-user.
At run-time all 3 levels are merged into a single configuration. This command displays the
merged configuration.</p>
</div>
<div class="refsect1">
<a name="p11-kit-extract"></a><h2>Extract</h2>
<p>Extract certificates from configured PKCS#11 modules.</p>
<p>This operation has been moved to a separate command <span class="command"><strong>trust extract</strong></span>.
See </p>
<table border="0" summary="Simple list" class="simplelist"><tr><td><span class="citerefentry"><span class="refentrytitle">trust</span>(1)</span></td></tr></table>
<p>
for more information</p>
</div>
<div class="refsect1">
<a name="p11-kit-server"></a><h2>Server</h2>
<p>Run a server process that exposes PKCS#11 module remotely.</p>
<pre class="programlisting">
$ p11-kit server pkcs11:token1 pkcs11:token2 ...
$ p11-kit server --provider /path/to/pkcs11-module.so pkcs11:token1 pkcs11:token2 ...
</pre>
<p>This launches a server that exposes the given PKCS#11 tokens on a local socket. The tokens must belong to the same module. To access the socket, use <code class="literal">p11-kit-client.so</code> module. The server address and PID are printed as a shell-script snippet which sets the appropriate environment variable: <code class="literal">P11_KIT_SERVER_ADDRESS</code> and <code class="literal">P11_KIT_SERVER_PID</code>.</p>
</div>
<div class="refsect1">
<a name="p11-kit-extract-trust"></a><h2>Extract Trust</h2>
<p>Extract standard trust information files.</p>
<p>This operation has been moved to a separate command <span class="command"><strong>trust extract-compat</strong></span>.
See <span class="citerefentry"><span class="refentrytitle">trust</span>(1)</span>
for more information</p>
</div>
<div class="refsect1">
<a name="p11-kit-remote"></a><h2>Remote</h2>
<p>Run a PKCS#11 module remotely.</p>
<pre class="programlisting">
$ p11-kit remote /path/to/pkcs11-module.so
$ p11-kit remote pkcs11:token1 pkcs11:token2 ...
</pre>
<p>This is not meant to be run directly from a terminal. But rather in a
<code class="option">remote</code> option in a
<span class="citerefentry"><span class="refentrytitle">pkcs11.conf</span>(5)</span>
file.</p>
<p>This exposes the given PKCS#11 module or tokens over standard input and output. Those two forms, whether to expose a module or tokens, are mutually exclusive and if the second form is used, the tokens must belong to the same module.</p>
</div>
<div class="refsect1">
<a name="p11-kit-bugs"></a><h2>Bugs</h2>
<p>
Please send bug reports to either the distribution bug tracker
or the upstream bug tracker at
<a class="ulink" href="https://github.com/p11-glue/p11-kit/issues/" target="_top">https://github.com/p11-glue/p11-kit/issues/</a>.
</p>
</div>
<div class="refsect1">
<a name="p11-kit-see-also"></a><h2>See also</h2>
<span class="simplelist"><span class="citerefentry"><span class="refentrytitle">pkcs11.conf</span>(5)</span></span><p>
Further details available in the p11-kit online documentation at
<a class="ulink" href="https://p11-glue.github.io/p11-glue/p11-kit/manual/" target="_top">https://p11-glue.github.io/p11-glue/p11-kit/manual/</a>.
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,262 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>pkcs11.conf: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="tools.html" title="Manual Pages">
<link rel="prev" href="p11-kit.html" title="p11-kit">
<link rel="next" href="trust.html" title="trust">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="tools.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="p11-kit.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="trust.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="pkcs11-conf"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">pkcs11.conf</span></h2>
<p>pkcs11.conf — Configuration files for PKCS#11 modules</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="pkcs11-conf-description"></a><h2>Description</h2>
<p>The <span class="command"><strong>pkcs11.conf</strong></span> configuration files are a standard
way to configure PKCS#11 modules.</p>
</div>
<div class="refsect1">
<a name="config-format"></a><h2>File format</h2>
<p>A complete configuration consists of several files. These files are
text files. Since <code class="literal">p11-kit</code> is built to be used in all
sorts of environments and at very low levels of the software stack, we
cannot make use of high level configuration APIs that you may find on a
modern desktop.</p>
<p>Each setting in the config file is specified consists of a name and
a value. The name is a simple string consisting of characters and dashes.
The name consists of alpha numeric characters, dot, hyphen and
underscore.</p>
<p>The value is specified after the name on the same line, separated
from it by a <code class="literal">:</code> (colon). White space between the
name and value is ignored.</p>
<p>Blank lines are ignored. White space at the beginning or end of
lines is stripped. Lines that begin with a <code class="literal">#</code> character
are ignored as comments. Comments are not recognized when they come after
a value on a line.</p>
<p>A fictitious module configuration file might look like:</p>
<pre class="programlisting">
module: module.so
# Here is a comment
managed: true
setting.2: A long value with text.
x-custom : text
</pre>
</div>
<div class="refsect1">
<a name="config-module"></a><h2>Module Configuration</h2>
<p>Each configured PKCS#11 module has its own config file. These files
can be <a class="link" href="pkcs11-conf.html#config-locations" title="Configuration Files">placed in various locations</a>.</p>
<p>The filename of the configuration file may consist of upper and lowercase letters
underscore, comma, dash and dots. The first characters needs to be an alphanumeric,
the filename should end with a <code class="literal">.module</code> extension.</p>
<p>Most importantly each config file specifies the path of the PKCS#11 module to
load. A module config file has the following fields:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">module:</code></span></p></td>
<td>
<p>The filename of the PKCS#11 module to load.
This should include an extension like <code class="literal">.so</code></p>
<p>If this value is blank, then the module will be ignored.
This can be used in the user configs to override loading of a module
specified in the system configuration.</p>
<p>If this is a relative path, then the module will be loaded
from the <a class="link" href="devel-paths.html#devel-paths-modules" title="Default path for modules with relative paths">default module directory</a>.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">critical:</code></span></p></td>
<td>
<p>Set to <code class="literal">yes</code> if the module is critical and
required to load. If a critical module fails to load or initialize,
then the loading process for all registered modules will abort and
return an error code.</p>
<p>This argument is optional and defaults to <code class="literal">no</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">enable-in:</code></span></p></td>
<td>
<p>A comma and/or space separated list of names of programs that
this module should only be loaded in. The module will not be loaded
for other programs using p11-kit. The base name of the process executable
should be used here, for example
<code class="literal">seahorse, ssh</code>.</p>
<p>This option can also be used to control whether the module will be loaded by <a class="link" href="sharing.html" title="Sharing PKCS#11 modules">the proxy module</a>. To enable loading only from the proxy module, specify <code class="literal">p11-kit-proxy</code> as the value.</p>
<p>This is not a security feature. The argument is optional. If
not present, then any process will load the module.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">disable-in:</code></span></p></td>
<td>
<p>A comma and/or space separated list of names of programs that
this module should not be loaded in. The module will be loaded for any
other programs using p11-kit. The base name of the process
executable should be used here, for example
<code class="literal">firefox, thunderbird-bin</code>.</p>
<p>This option can also be used to control whether the module will be loaded by <a class="link" href="sharing.html" title="Sharing PKCS#11 modules">the proxy module</a>. To disable loading from the proxy module, specify <code class="literal">p11-kit-proxy</code> as the value.</p>
<p>This is not a security feature. The argument is optional. If
not present, then any process will load the module.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">managed:</code></span></p></td>
<td>
<p>Set to <code class="literal">no</code> if the module is not to be managed by
p11-kit. Making a module unmanaged is not recommended, and will cause
problems if multiple callers in a single process share a PKCS#11 module.</p>
<p>This argument is optional and defaults to <code class="literal">yes</code>.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">priority:</code></span></p></td>
<td>
<p>The value should be an integer. When lists of modules are
returned to a caller of p11-kit, modules with a higher number are sorted
first. When applications search modules for certificates, keys and
trust policy information, this setting will affect what find
first.</p>
<p>This argument is optional, and defaults to zero. Modules
with the same <code class="option">priority</code> option will be sorted
alphabetically.</p>
</td>
</tr>
<tr>
<td><p><a name="option-remote"></a><span class="term"><code class="option">remote:</code></span></p></td>
<td>
<p>Instead of loading the PKCS#11 module locally, run the module
remotely.</p>
<p>Specify a command to run, prefixed with <code class="literal">|</code> a pipe.
The command must speak the p11-kit remoting protocol on its standard in
and standard out. For example:</p>
<pre class="programlisting">
remote: |ssh user@remote p11-kit remote /path/to/module.so
</pre>
<p>Other forms of remoting will appear in later p11-kit releases.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">trust-policy:</code></span></p></td>
<td><p>Set to <code class="literal">yes</code> to use use this module as a source
of trust policy information such as certificate anchors and blocklists.</p></td>
</tr>
<tr>
<td><p><a name="option-log-calls"></a><span class="term"><code class="option">log-calls:</code></span></p></td>
<td>
<p>Set to <code class="literal">yes</code> to write a log to stderr of all the
calls into the module. This is only supported for managed modules.</p>
<p>This argument is optional and defaults to <code class="literal">no</code>.</p>
</td>
</tr>
</tbody>
</table></div>
<p>Do not specify both <code class="literal">enable-in</code> and <code class="literal">disable-in</code>
for the same module.</p>
<p>Other fields may be present, but it is recommended that field names
that are not specified in this document start with a <code class="literal">x-</code>
prefix.</p>
</div>
<div class="refsect1">
<a name="config-global"></a><h2>Global Configuration</h2>
<p>A global configuration may also be present. This file contains settings
that are not related to a single PKCS#11 module. The location(s) of the
global configuration are described below. The global configuration file
can contain the following fields:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">user-config:</code></span></p></td>
<td><p>This will be equal to one of the following values:
<code class="literal">none</code>, <code class="literal">merge</code>,
<code class="literal">only</code>.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">managed:</code></span></p></td>
<td>
<p>Set to <code class="literal">yes</code> or <code class="literal">no</code> to
force all modules to be managed or unmanaged by p11-kit. Setting this
setting in a global configuration file will override the
<code class="literal">managed</code> setting in the individual module configuration
files. Making modules unmanaged is not recommended, and will cause
problems if multiple callers in a single process share a PKCS#11
module.</p>
<p>This argument is optional.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">log-calls:</code></span></p></td>
<td>
<p>Set to <code class="literal">yes</code> to write a log to stderr of all the
calls into all configured modules. This is only supported for managed
modules.</p>
<p>This argument is optional.</p>
</td>
</tr>
</tbody>
</table></div>
<p>Other fields may be present, but it is recommended that field names
that are not specified in this document start with a <code class="literal">x-</code>
prefix.</p>
</div>
<div class="refsect1">
<a name="config-locations"></a><h2>Configuration Files</h2>
<p>Each configured PKCS#11 module has its own config file. These
files are placed in a directory. In addition a global config file exists.
There is a system configuration consisting of the various module config
files and a file for global configuration. Optionally each user can provide
additional configuration or override the system configuration.</p>
<p>The system global configuration file is usually in
<code class="literal">/etc/pkcs11/pkcs11.conf</code> and the user global
configuration file is in <code class="literal">~/.config/pkcs11/pkcs11.conf</code> in the
user's home directory.</p>
<p>The module config files are usually located in the
<code class="literal">/etc/pkcs11/modules</code> directory, with one configuration
file per module. In addition the <code class="literal">~/.config/pkcs11/modules</code> directory
can be used for modules installed by the user.</p>
<p>Note that user configuration files are not loaded from the home
directory if running inside a setuid or setgid program.</p>
<p>The default system config file and module directory can be changed
when building p11-kit. Always
<a class="link" href="devel-paths.html" title="Packaging PKCS#11 module configs">lookup these paths</a> using
<code class="literal">pkg-config</code>.</p>
</div>
<div class="refsect1">
<a name="pkcs11-conf-see-also"></a><h2>See also</h2>
<span class="simplelist"><span class="citerefentry"><span class="refentrytitle">p11-kit</span>(8)</span></span><p>Further details available in the p11-kit online documentation at
<a class="ulink" href="https://p11-glue.github.io/p11-glue/p11-kit/manual/" target="_top">https://p11-glue.github.io/p11-glue/p11-kit/manual/</a>.
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,567 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Reference: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="trust.html" title="trust">
<link rel="next" href="p11-kit-Modules.html" title="Modules">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="trust.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="p11-kit-Modules.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="reference"></a>API Reference</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt>
<span class="refentrytitle"><a href="p11-kit-Modules.html">Modules</a></span><span class="refpurpose"> — Module loading and initializing</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-URIs.html">URIs</a></span><span class="refpurpose"> — Parsing and formatting PKCS#11 URIs</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-PIN-Callbacks.html">PIN Callbacks</a></span><span class="refpurpose"> — PIN Callbacks</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Utilities.html">Utilities</a></span><span class="refpurpose"> — PKCS#11 utilities</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Future.html">Future</a></span><span class="refpurpose"> — Future Unstable API</span>
</dt>
<dt>
<span class="refentrytitle"><a href="p11-kit-Deprecated.html">Deprecated</a></span><span class="refpurpose"> — Deprecated functions</span>
</dt>
<dt><span class="index"><a href="reference.html#api-index-full">API Index</a></span></dt>
<dt><span class="glossary"><a href="reference.html#annotation-glossary">Annotation Glossary</a></span></dt>
</dl></div>
<div class="index">
<div class="titlepage"><div><div><h2 class="title">
<a name="api-index-full"></a>API Index</h2></div></div></div>
<a name="idx"></a><a name="idxB"></a><h3 class="title">B</h3>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-be-loud" title="p11_kit_be_loud ()">p11_kit_be_loud</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-be-quiet" title="p11_kit_be_quiet ()">p11_kit_be_quiet</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<a name="idxC"></a><h3 class="title">C</h3>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-config-option" title="p11_kit_config_option ()">p11_kit_config_option</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<a name="idxD"></a><h3 class="title">D</h3>
<dt>
<a class="link" href="p11-kit-Deprecated.html#P11-KIT-DEPRECATED-FOR:CAPS" title="P11_KIT_DEPRECATED_FOR()">P11_KIT_DEPRECATED_FOR</a>, macro in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-destroyer" title="p11_kit_destroyer ()">p11_kit_destroyer</a>, user_function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<a name="idxF"></a><h3 class="title">F</h3>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-finalize-module" title="p11_kit_finalize_module ()">p11_kit_finalize_module</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-finalize-registered" title="p11_kit_finalize_registered ()">p11_kit_finalize_registered</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<a name="idxI"></a><h3 class="title">I</h3>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-initialize-module" title="p11_kit_initialize_module ()">p11_kit_initialize_module</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-initialize-registered" title="p11_kit_initialize_registered ()">p11_kit_initialize_registered</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter" title="p11_kit_iter">p11_kit_iter</a>, typedef in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-add-callback" title="p11_kit_iter_add_callback ()">p11_kit_iter_add_callback</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-add-filter" title="p11_kit_iter_add_filter ()">p11_kit_iter_add_filter</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-begin" title="p11_kit_iter_begin ()">p11_kit_iter_begin</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-begin-with" title="p11_kit_iter_begin_with ()">p11_kit_iter_begin_with</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-callback" title="p11_kit_iter_callback ()">p11_kit_iter_callback</a>, user_function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-destroy-object" title="p11_kit_iter_destroy_object ()">p11_kit_iter_destroy_object</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-free" title="p11_kit_iter_free ()">p11_kit_iter_free</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-attributes" title="p11_kit_iter_get_attributes ()">p11_kit_iter_get_attributes</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-kind" title="p11_kit_iter_get_kind ()">p11_kit_iter_get_kind</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-module" title="p11_kit_iter_get_module ()">p11_kit_iter_get_module</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-object" title="p11_kit_iter_get_object ()">p11_kit_iter_get_object</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-session" title="p11_kit_iter_get_session ()">p11_kit_iter_get_session</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-slot" title="p11_kit_iter_get_slot ()">p11_kit_iter_get_slot</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-slot-info" title="p11_kit_iter_get_slot_info ()">p11_kit_iter_get_slot_info</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-get-token" title="p11_kit_iter_get_token ()">p11_kit_iter_get_token</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-keep-session" title="p11_kit_iter_keep_session ()">p11_kit_iter_keep_session</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-load-attributes" title="p11_kit_iter_load_attributes ()">p11_kit_iter_load_attributes</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-new" title="p11_kit_iter_new ()">p11_kit_iter_new</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-next" title="p11_kit_iter_next ()">p11_kit_iter_next</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-iter-set-uri" title="p11_kit_iter_set_uri ()">p11_kit_iter_set_uri</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<a name="idxL"></a><h3 class="title">L</h3>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-load-initialize-module" title="p11_kit_load_initialize_module ()">p11_kit_load_initialize_module</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<a name="idxM"></a><h3 class="title">M</h3>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-message" title="p11_kit_message ()">p11_kit_message</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-finalize" title="p11_kit_modules_finalize ()">p11_kit_modules_finalize</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-finalize-and-release" title="p11_kit_modules_finalize_and_release ()">p11_kit_modules_finalize_and_release</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-initialize" title="p11_kit_modules_initialize ()">p11_kit_modules_initialize</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()">p11_kit_modules_load</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load-and-initialize" title="p11_kit_modules_load_and_initialize ()">p11_kit_modules_load_and_initialize</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-release" title="p11_kit_modules_release ()">p11_kit_modules_release</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-CRITICAL:CAPS" title="P11_KIT_MODULE_CRITICAL">P11_KIT_MODULE_CRITICAL</a>, macro in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-finalize" title="p11_kit_module_finalize ()">p11_kit_module_finalize</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-for-name" title="p11_kit_module_for_name ()">p11_kit_module_for_name</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-filename" title="p11_kit_module_get_filename ()">p11_kit_module_get_filename</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-flags" title="p11_kit_module_get_flags ()">p11_kit_module_get_flags</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-get-name" title="p11_kit_module_get_name ()">p11_kit_module_get_name</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-initialize" title="p11_kit_module_initialize ()">p11_kit_module_initialize</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-load" title="p11_kit_module_load ()">p11_kit_module_load</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#p11-kit-module-release" title="p11_kit_module_release ()">p11_kit_module_release</a>, function in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Modules.html#P11-KIT-MODULE-UNMANAGED:CAPS" title="P11_KIT_MODULE_UNMANAGED">P11_KIT_MODULE_UNMANAGED</a>, macro in <a class="link" href="p11-kit-Modules.html" title="Modules">Modules</a>
</dt>
<dd></dd>
<a name="idxP"></a><h3 class="title">P</h3>
<dt>
<a class="link" href="p11-kit-Future.html#P11KitIter" title="P11KitIter">P11KitIter</a>, typedef in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#P11KitIterBehavior" title="enum P11KitIterBehavior">P11KitIterBehavior</a>, enum in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#P11KitIterKind" title="enum P11KitIterKind">P11KitIterKind</a>, enum in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPin" title="P11KitPin">P11KitPin</a>, typedef in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#P11KitPinFlags" title="enum P11KitPinFlags">P11KitPinFlags</a>, enum in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11KitUri" title="P11KitUri">P11KitUri</a>, typedef in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11KitUriResult" title="enum P11KitUriResult">P11KitUriResult</a>, enum in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11KitUriType" title="enum P11KitUriType">P11KitUriType</a>, enum in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-callback" title="p11_kit_pin_callback ()">p11_kit_pin_callback</a>, user_function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-destroy-func" title="p11_kit_pin_destroy_func ()">p11_kit_pin_destroy_func</a>, user_function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#P11-KIT-PIN-FALLBACK:CAPS" title="P11_KIT_PIN_FALLBACK">P11_KIT_PIN_FALLBACK</a>, macro in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-file-callback" title="p11_kit_pin_file_callback ()">p11_kit_pin_file_callback</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-length" title="p11_kit_pin_get_length ()">p11_kit_pin_get_length</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-get-value" title="p11_kit_pin_get_value ()">p11_kit_pin_get_value</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new" title="p11_kit_pin_new ()">p11_kit_pin_new</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-buffer" title="p11_kit_pin_new_for_buffer ()">p11_kit_pin_new_for_buffer</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-new-for-string" title="p11_kit_pin_new_for_string ()">p11_kit_pin_new_for_string</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-ref" title="p11_kit_pin_ref ()">p11_kit_pin_ref</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-register-callback" title="p11_kit_pin_register_callback ()">p11_kit_pin_register_callback</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-request" title="p11_kit_pin_request ()">p11_kit_pin_request</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unref" title="p11_kit_pin_unref ()">p11_kit_pin_unref</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-PIN-Callbacks.html#p11-kit-pin-unregister-callback" title="p11_kit_pin_unregister_callback ()">p11_kit_pin_unregister_callback</a>, function in <a class="link" href="p11-kit-PIN-Callbacks.html" title="PIN Callbacks">PIN Callbacks</a>
</dt>
<dd></dd>
<a name="idxR"></a><h3 class="title">R</h3>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-modules" title="p11_kit_registered_modules ()">p11_kit_registered_modules</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-module-to-name" title="p11_kit_registered_module_to_name ()">p11_kit_registered_module_to_name</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-name-to-module" title="p11_kit_registered_name_to_module ()">p11_kit_registered_name_to_module</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Deprecated.html#p11-kit-registered-option" title="p11_kit_registered_option ()">p11_kit_registered_option</a>, function in <a class="link" href="p11-kit-Deprecated.html" title="Deprecated">Deprecated</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-remote-serve-module" title="p11_kit_remote_serve_module ()">p11_kit_remote_serve_module</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-remote-serve-token" title="p11_kit_remote_serve_token ()">p11_kit_remote_serve_token</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-remote-serve-tokens" title="p11_kit_remote_serve_tokens ()">p11_kit_remote_serve_tokens</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<a name="idxS"></a><h3 class="title">S</h3>
<dt>
<a class="link" href="p11-kit-Future.html#p11-kit-set-progname" title="p11_kit_set_progname ()">p11_kit_set_progname</a>, function in <a class="link" href="p11-kit-Future.html" title="Future">Future</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-space-strdup" title="p11_kit_space_strdup ()">p11_kit_space_strdup</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-space-strlen" title="p11_kit_space_strlen ()">p11_kit_space_strlen</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-Utilities.html#p11-kit-strerror" title="p11_kit_strerror ()">p11_kit_strerror</a>, function in <a class="link" href="p11-kit-Utilities.html" title="Utilities">Utilities</a>
</dt>
<dd></dd>
<a name="idxU"></a><h3 class="title">U</h3>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri" title="p11_kit_uri">p11_kit_uri</a>, typedef in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-any-unrecognized" title="p11_kit_uri_any_unrecognized ()">p11_kit_uri_any_unrecognized</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-clear-attribute" title="p11_kit_uri_clear_attribute ()">p11_kit_uri_clear_attribute</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-clear-attributes" title="p11_kit_uri_clear_attributes ()">p11_kit_uri_clear_attributes</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-format" title="p11_kit_uri_format ()">p11_kit_uri_format</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-free" title="p11_kit_uri_free ()">p11_kit_uri_free</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-attribute" title="p11_kit_uri_get_attribute ()">p11_kit_uri_get_attribute</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-attributes" title="p11_kit_uri_get_attributes ()">p11_kit_uri_get_attributes</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-module-info" title="p11_kit_uri_get_module_info ()">p11_kit_uri_get_module_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-module-name" title="p11_kit_uri_get_module_name ()">p11_kit_uri_get_module_name</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-module-path" title="p11_kit_uri_get_module_path ()">p11_kit_uri_get_module_path</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-pinfile" title="p11_kit_uri_get_pinfile ()">p11_kit_uri_get_pinfile</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-pin-source" title="p11_kit_uri_get_pin_source ()">p11_kit_uri_get_pin_source</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-pin-value" title="p11_kit_uri_get_pin_value ()">p11_kit_uri_get_pin_value</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-slot-id" title="p11_kit_uri_get_slot_id ()">p11_kit_uri_get_slot_id</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-slot-info" title="p11_kit_uri_get_slot_info ()">p11_kit_uri_get_slot_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-token-info" title="p11_kit_uri_get_token_info ()">p11_kit_uri_get_token_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-get-vendor-query" title="p11_kit_uri_get_vendor_query ()">p11_kit_uri_get_vendor_query</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-match-attributes" title="p11_kit_uri_match_attributes ()">p11_kit_uri_match_attributes</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-match-module-info" title="p11_kit_uri_match_module_info ()">p11_kit_uri_match_module_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-match-slot-info" title="p11_kit_uri_match_slot_info ()">p11_kit_uri_match_slot_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-match-token-info" title="p11_kit_uri_match_token_info ()">p11_kit_uri_match_token_info</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-message" title="p11_kit_uri_message ()">p11_kit_uri_message</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-new" title="p11_kit_uri_new ()">p11_kit_uri_new</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11-KIT-URI-NO-MEMORY:CAPS" title="P11_KIT_URI_NO_MEMORY">P11_KIT_URI_NO_MEMORY</a>, macro in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-parse" title="p11_kit_uri_parse ()">p11_kit_uri_parse</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11-KIT-URI-SCHEME:CAPS" title="P11_KIT_URI_SCHEME">P11_KIT_URI_SCHEME</a>, macro in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#P11-KIT-URI-SCHEME-LEN:CAPS" title="P11_KIT_URI_SCHEME_LEN">P11_KIT_URI_SCHEME_LEN</a>, macro in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-attribute" title="p11_kit_uri_set_attribute ()">p11_kit_uri_set_attribute</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-attributes" title="p11_kit_uri_set_attributes ()">p11_kit_uri_set_attributes</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-module-name" title="p11_kit_uri_set_module_name ()">p11_kit_uri_set_module_name</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-module-path" title="p11_kit_uri_set_module_path ()">p11_kit_uri_set_module_path</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-pinfile" title="p11_kit_uri_set_pinfile ()">p11_kit_uri_set_pinfile</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-pin-source" title="p11_kit_uri_set_pin_source ()">p11_kit_uri_set_pin_source</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-pin-value" title="p11_kit_uri_set_pin_value ()">p11_kit_uri_set_pin_value</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-slot-id" title="p11_kit_uri_set_slot_id ()">p11_kit_uri_set_slot_id</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-unrecognized" title="p11_kit_uri_set_unrecognized ()">p11_kit_uri_set_unrecognized</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="p11-kit-URIs.html#p11-kit-uri-set-vendor-query" title="p11_kit_uri_set_vendor_query ()">p11_kit_uri_set_vendor_query</a>, function in <a class="link" href="p11-kit-URIs.html" title="URIs">URIs</a>
</dt>
<dd></dd>
</div>
<div class="glossary">
<div class="titlepage"><div><div><h2 class="title">
<a name="annotation-glossary"></a>Annotation Glossary</h2></div></div></div>
<a name="glsA"></a><h3 class="title">A</h3>
<dt><span class="glossterm"><a name="annotation-glossterm-allow-none"></a>allow-none</span></dt>
<dd class="glossdef"><p>NULL is ok, both for passing and for returning.</p></dd>
<dt><span class="glossterm"><a name="annotation-glossterm-array"></a>array</span></dt>
<dd class="glossdef"><p>Parameter points to an array of items.</p></dd>
<a name="glsE"></a><h3 class="title">E</h3>
<dt><span class="glossterm"><a name="annotation-glossterm-element-type"></a>element-type</span></dt>
<dd class="glossdef"><p>Generics and defining elements of containers and arrays.</p></dd>
<a name="glsI"></a><h3 class="title">I</h3>
<dt><span class="glossterm"><a name="annotation-glossterm-inout"></a>inout</span></dt>
<dd class="glossdef"><p>Parameter for input and for returning results. Default is <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>.</p></dd>
<a name="glsO"></a><h3 class="title">O</h3>
<dt><span class="glossterm"><a name="annotation-glossterm-out"></a>out</span></dt>
<dd class="glossdef"><p>Parameter for returning results. Default is <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>.</p></dd>
<a name="glsT"></a><h3 class="title">T</h3>
<dt><span class="glossterm"><a name="annotation-glossterm-transfer%20full"></a>transfer full</span></dt>
<dd class="glossdef"><p>Free data after the code is done.</p></dd>
<dt><span class="glossterm"><a name="annotation-glossterm-type"></a>type</span></dt>
<dd class="glossdef"><p>Override the parsed C type with given type</p></dd>
<dt><span class="glossterm"><a name="annotation-glossterm-transfer%20none"></a>transfer none</span></dt>
<dd class="glossdef"><p>Don't free data after the code is done.</p></dd>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,230 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Remoting / Forwarding: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="sharing.html" title="Proxy Module">
<link rel="next" href="trust-module.html" title="Trust Policy Module">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="sharing.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="trust-module.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="remoting"></a>Remoting / Forwarding</h1></div></div></div>
<p>Smartcards or hardware security modules (HSM) are technologies to
keep private keys on devices physically isolated to a device only available
to the user. That way only the intended user can use that device to authenticate,
authorize or perform other functions that involve the private keys. These come
usually in the form of a USB device or token which is plugged into the local computer.
</p>
<p>In modern "cloud" computing, it is often desirable to virtually transfer such
a device on remote servers. For example, one can sign software or documents on a remote
server, use the local smart card to authorize itself to Kerberos, or any other
possible use. There are various approaches to tackle that problem, and on different
levels of the smart card application stack. It is possible to forward the USB
device holding the smart card, or forward the lower-level PC/SC protocol which
some smart cards talk, or forward the high-level interface used to communicate
with smart cards, the PKCS#11 interface.</p>
<p>To address that problem, in p11-kit, we allow the forwarding of
the higher level smart card interface, PKCS#11. In the following paragraphs
we describe the approach and tools needed to perform that forwarding over SSH
secure communication channels.</p>
<div class="refsect1">
<a name="remoting-scenario"></a><h2>Scenario</h2>
<p>We assume having a local workstation, and a remote server. On the local
computer we have inserted a smart card, in our examples we use a Nitrokey
card with the OpenSC drivers. We will forward the card
from the workstation to the remote server.</p>
</div>
<div class="refsect1">
<a name="remoting-setup"></a><h2>Setting up the PKCS#11 forwarding server on a local client</h2>
<p>To forward a smartcard to a remote server, we first need to identify which
smartcards are available. To list the smartcards currently attached to the local
computer, use the p11tool command from the gnutls package. For example:
</p>
<pre class="programlisting">
$ p11tool --list-tokens
...
Token 6:
URL: pkcs11:model=PKCS%2315%20emulated;manufacturer=www.CardContact.de;serial=DENK0000000;token=UserPIN%20%28Daiki%27s%20token%29
Label: UserPIN (Daiki's token)
Type: Hardware token
Manufacturer: www.CardContact.de
Model: PKCS#15 emulated
Serial: DENK0000000
Module: opensc-pkcs11.so
...
</pre>
<p>This is the entry for the card we'd like to forward to remote system. The important
pieces are the 'pkcs11:' URL listed above, and the module name. Once we determine which
smartcard to forward, we expose it to a local Unix domain socket, with the following
p11-kit server command.
</p>
<pre class="programlisting">
$ p11-kit server --provider /usr/lib64/pkcs11/opensc-pkcs11.so "pkcs11:model=PKCS%2315%20emulated;manufacturer=www.CardContact.de;serial=DENK0000000;token=UserPIN%20%28Daiki%27s%20token%29"
</pre>
<p>Here we provide to the server the module location (optional) with the --provider
option, as well as the URL of the card. We copied the values from the Module and URL
lines of the p11tool output above. When the p11-kit server command starts, it will
print the address of the PKCS#11 unix domain socket and the process ID of the server.
</p>
<pre class="programlisting">
P11_KIT_SERVER_ADDRESS=unix:path=/run/user/12345/p11-kit/pkcs11-12345
P11_KIT_SERVER_PID=12345
</pre>
<p>For later use, set the variables output by the tool on your shell prompt
(e.g., copy and paste them or call the above p11-kit server command line with
<code class="literal">eval $(p11-kit server ...)</code>).
</p>
</div>
<div class="refsect1">
<a name="remoting-forwarding-socket"></a><h2>Forwarding and using the PKCS#11 Unix socket on the remote server</h2>
<p>On the remote server, we will initially forward the previously generated PKCS#11
unix socket, and then access the smart card through it. To access the forwarded socket
as if it were a smart card, a dedicated PKCS#11 module p11-kit-client.so is provided as
part of the p11-kit-server package.
</p>
</div>
<div class="refsect1">
<a name="remoting-forwarding-socket-prep"></a><h2>Preparing the remote system for PKCS#11 socket forwarding</h2>
<p>One important detail you should be aware of, is the file system location of the
forwarded socket. By convention, the p11-kit-client.so module utilizes the "user runtime
directory", managed by systemd; the directory is created when a user logs in, and removed
upon logout, so that the user doesn't need to manually clean up the socket file.
</p>
<p>To locate your user runtime directory, do:
</p>
<pre class="programlisting">
$ systemd-path user-runtime
/run/user/1000
</pre>
<p>The <code class="literal">p11-kit-client.so</code> module looks for the socket file under a
subdirectory (<code class="literal">/run/user/1000/p11-kit</code> in this example). To enable
auto-creation of the directory, do the following.
</p>
<pre class="programlisting">
$ systemctl --user enable p11-kit-client.service
</pre>
</div>
<div class="refsect1">
<a name="remoting-finally-forwarding"></a><h2>Forwarding the PKCS#11 socket</h2>
<p>We will use ssh to forward the local PKCS#11 unix socket to the remote server.
Following the p11-kit-client convention, we will forward the socket to the remote user
run-time path so that cleaning up on disconnect is not required. The remote location
of the run-time path can be obtained as follows.
</p>
<pre class="programlisting">
$ ssh [user]@[remotehost] systemd-path user-runtime
/run/user/1000
</pre>
<p>The number at the end of the path above is your user ID in that system
(and thus will vary from user to user). You can now forward the Unix domain socket
with the -R option of the ssh command, after replacing the example path with the
actual run-time path.
</p>
<pre class="programlisting">
$ ssh -R /run/user/[userID]/p11-kit/pkcs11:${P11_KIT_SERVER_ADDRESS#*=} [user]@[remotehost]
</pre>
<p>After successfully logging in to the remote host, you can use the forwarded
smartcard as if it were directly connected to the server using the
<code class="literal">p11-kit-client.so</code>. Note that if any error occurs during the forwarding
setup, you will see something like this on your terminal:
</p>
<pre class="programlisting">
Warning: remote port forwarding failed for listen path /run/user/...
</pre>
</div>
<div class="refsect1">
<a name="remoting-using"></a><h2>Using the forwarded PKCS#11 socket</h2>
<p>Let's first make sure the smart card works on the remote system, by listing it:
</p>
<pre class="programlisting">
$ ls -l /run/user/1000/p11-kit/pkcs11
$ p11tool --provider /usr/lib64/pkcs11/p11-kit-client.so --list-tokens
...
Token 0:
URL: pkcs11:model=PKCS%2315%20emulated;manufacturer=www.CardContact.de;serial=DENK0000000;token=UserPIN%20%28Daiki%27s%20token%29
Label: UserPIN (Daiki's token)
Type: Hardware token
Manufacturer: www.CardContact.de
Model: PKCS#15 emulated
Serial: DENK0000000
Module: (null)
...
</pre>
<p>We can similarly generate, copy objects or test certificates to the card using
the same command. Any applications which support PKCS#11 can perform cryptographic
operations through the client module.
</p>
</div>
<div class="refsect1">
<a name="remoting-registering"></a><h2>Registering the client module for use with OpenSSL and GnuTLS apps</h2>
<p>To utilize the p11-kit-client module with OpenSSL (via engine_pkcs11 provided
by the libp11 package) and GnuTLS applications, you have to register it in
p11-kit. To do it for the current user, use the following commands:
</p>
<pre class="programlisting">
$ mkdir .config/pkcs11/modules/
$ echo "module: /usr/lib64/pkcs11/p11-kit-client.so" &gt;.config/pkcs11/modules/p11-kit-client.module
</pre>
<p>Once this is done both OpenSSL and GnuTLS applications should work, for example:
</p>
<pre class="programlisting">
$ URL="pkcs11:model=PKCS%2315%20emulated;manufacturer=www.CardContact.de;serial=DENK0000000;token=UserPIN%20%28Daiki%27s%20token%29"
# Generate a key using gnutls p11tool
$ p11tool --generate-ecc --login --label test-key "$URL"
# generate a certificate request with the previous key using openssl
$ openssl req -engine pkcs11 -new -key "$URL;;object=test-key;type=private;pin-value=XXXX" \
-keyform engine -out req.pem -text -subj "/CN=Test user"
</pre>
<p>Note that the token URL remains the same in the forwarded system as in the original one.
</p>
</div>
<div class="refsect1">
<a name="remoting-ssh"></a><h2>Using the client module with OpenSSH</h2>
<p>To re-use the already forwarded smartcard for authentication with another remote host, you can run ssh and provide the -I option with p11-kit-client.so. For example:
</p>
<pre class="programlisting">
$ ssh -I /usr/lib64/pkcs11/p11-kit-client.so [user]@[anotherhost]
</pre>
</div>
<div class="refsect1">
<a name="remoting-nss"></a><h2>Using the client module with NSS applications</h2>
<p>To register the forwarded smartcard in NSS applications, you can set it up with
the modutil command, as follows.
</p>
<pre class="programlisting">
$ sudo modutil -dbdir /etc/pki/nssdb -add p11-kit-client -libfile /usr/lib64/pkcs11/p11-kit-client.so
$ modutil -dbdir /etc/pki/nssdb -list
...
3. p11-kit-client
library name: /usr/lib64/pkcs11/p11-kit-client.so
uri: pkcs11:library-manufacturer=OpenSC%20Project;library-description=OpenSC%20smartcard%20framework;library-version=0.17
slots: 1 slot attached
status: loaded
slot: Nitrokey Nitrokey HSM (010000000000000000000000) 00 00
token: UserPIN (Daiki's token)
uri: pkcs11:token=UserPIN%20(Daiki's%20token);manufacturer=www.CardContact.de;serial=DENK0000000;model=PKCS%2315%20emulated
</pre>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

View File

@@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Managed modules: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="sharing.html" title="Sharing PKCS#11 modules">
<link rel="prev" href="sharing.html" title="Sharing PKCS#11 modules">
<link rel="next" href="sharing.html" title="Proxy Module">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="sharing.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="sharing.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="sharing.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="sharing-managed"></a>Managed modules</h2></div></div></div>
<p><code class="literal">p11-kit</code> wraps PKCS#11 modules to manage
them and customize their functionality so that they are able
to be shared between multiple callers in the same process.</p>
<p>Each caller that uses the
<a class="link" href="p11-kit-Modules.html#p11-kit-modules-load" title="p11_kit_modules_load ()"><code class="function">p11_kit_modules_load()</code></a>
or <a class="link" href="p11-kit-Modules.html#p11-kit-module-load" title="p11_kit_module_load ()"><code class="function">p11_kit_module_load()</code></a>
function gets independent wrapped PKCS#11 module(s). This is unless a caller
or module configuration specifies that a module should be used in an
unmanaged fashion.</p>
<p>When modules are managed, the following aspects are wrapped and
coordinated:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>Calls to <code class="literal">C_Initialize</code> and
<code class="literal">C_Finalize</code> can be called by multiple
callers.</p>
<p>The first time that the managed module
<code class="literal">C_Initialize</code> is called, the PKCS#11 module's actual
<code class="literal">C_Initialize</code> function is called. Subsequent calls by
other callers will cause <code class="literal">p11-kit</code> to increment an
internal initialization count, rather than calling
<code class="literal">C_Initialize</code> again.</p>
<p>Multiple callers can call the managed
<code class="literal">C_Initialize</code> function concurrently from different
threads and <code class="literal">p11-kit</code> will guarantee that this managed
in a thread-safe manner.</p>
</li>
<li class="listitem">
<p>When the managed module <code class="literal">C_Finalize</code> is used
to finalize a module, each time it is called it decrements the internal
initialization count for that module. When the internal initialization
count reaches zero, the module's actual <code class="literal">C_Finalize</code>
function is called.</p>
<p>Multiple callers can call the managed <code class="literal">C_Finalize</code>
function concurrently from different threads and <code class="literal">p11-kit</code>
will guarantee that this managed in a thread-safe manner.</p>
</li>
<li class="listitem"><p>Call to <code class="literal">C_CloseAllSessions</code> only close the
sessions that the caller of the managed module has opened. This allows the
<code class="literal">C_CloseAllSessions</code> function to be used without closing
sessions for other callers of the same PKCS#11 module.</p></li>
<li class="listitem"><p>Managed modules have ability to log PKCS#11 method calls for debugging
purposes. See the <a class="link" href="pkcs11-conf.html#option-log-calls"><code class="literal">log-calls = yes</code></a>
module configuration option.</p></li>
<li class="listitem"><p>Managed modules have the ability to be remoted to another machine or
isolated in their own process.
See the <a class="link" href="pkcs11-conf.html#option-remote"><code class="literal">remote = ...</code></a>
module configuration option.</p></li>
</ul></div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Proxy Module: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="sharing-managed.html" title="Managed modules">
<link rel="next" href="remoting.html" title="Remoting / Forwarding">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="sharing-managed.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="remoting.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="sharing"></a>Proxy Module</h1></div></div></div>
<p>When an application is aware of the fact that coordination
is necessary between multiple consumers of a PKCS#11 module, and wants
to load standard configured PKCS#11 modules, it can link to
<code class="literal">p11-kit</code> and use the functions there to provide this
functionality.</p>
<p>However most current consumers of PKCS#11 are ignorant of
this problem, and do not link to p11-kit. In order to solve this
multiple initialization problem for all applications,
<code class="literal">p11-kit</code> provides a proxy compatibility
module.</p>
<p>This proxy module acts like a normal PKCS#11 module, but
internally loads a preconfigured set of PKCS#11 modules and
manages their features as described earlier. Each slot in the configured modules
is exposed as a slot of the <code class="literal">p11-kit</code> proxy module. The proxy
module is then used as a normal PKCS#11 module would be. It can be loaded by
crypto libraries like NSS and behaves as expected.</p>
<p>The <code class="literal">C_GetFunctionList</code>,
<code class="literal">C_GetInterfaceList</code> and <code class="literal">C_GetInterface</code>
exported entry points of the proxy module returns a new managed PKCS#11 module
each time it is called. These managed instances are released when the proxy
module is unloaded.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,531 @@
body
{
font-family: cantarell, sans-serif;
}
.synopsis, .classsynopsis
{
/* tango:aluminium 1/2 */
background: #eeeeec;
background: rgba(238, 238, 236, 0.5);
border: solid 1px rgb(238, 238, 236);
padding: 0.5em;
}
.programlisting
{
/* tango:sky blue 0/1 */
/* fallback for no rgba support */
background: #e6f3ff;
border: solid 1px #729fcf;
background: rgba(114, 159, 207, 0.1);
border: solid 1px rgba(114, 159, 207, 0.2);
padding: 0.5em;
}
.variablelist
{
padding: 4px;
margin-left: 3em;
}
.variablelist td:first-child
{
vertical-align: top;
}
span.nowrap {
white-space: nowrap;
}
div.gallery-float
{
float: left;
padding: 10px;
}
div.gallery-float img
{
border-style: none;
}
div.gallery-spacer
{
clear: both;
}
a, a:visited
{
text-decoration: none;
/* tango:sky blue 2 */
color: #3465a4;
}
a:hover
{
text-decoration: underline;
/* tango:sky blue 1 */
color: #729fcf;
}
.function_type,
.variable_type,
.property_type,
.signal_type,
.parameter_name,
.struct_member_name,
.union_member_name,
.define_keyword,
.datatype_keyword,
.typedef_keyword
{
text-align: right;
}
/* dim non-primary columns */
.c_punctuation,
.function_type,
.variable_type,
.property_type,
.signal_type,
.define_keyword,
.datatype_keyword,
.typedef_keyword,
.property_flags,
.signal_flags,
.parameter_annotations,
.enum_member_annotations,
.struct_member_annotations,
.union_member_annotations
{
color: #888a85;
}
.function_type a,
.function_type a:visited,
.function_type a:hover,
.property_type a,
.property_type a:visited,
.property_type a:hover,
.signal_type a,
.signal_type a:visited,
.signal_type a:hover,
.signal_flags a,
.signal_flags a:visited,
.signal_flags a:hover
{
color: #729fcf;
}
td p
{
margin: 0.25em;
}
div.informaltable table[border="1"],
div.table table
{
border-collapse: collapse;
border-spacing: 0px;
/* tango:aluminium 3 */
border: solid 1px #babdb6;
}
div.informaltable table[border="1"] td,
div.informaltable table th,
div.table table td, div.table table th
{
/* tango:aluminium 3 */
border: solid 1px #babdb6;
padding: 3px;
vertical-align: top;
}
div.informaltable table[border="1"] th,
div.table table th
{
/* tango:aluminium 2 */
background-color: #d3d7cf;
}
h4
{
color: #555753;
margin-top: 1em;
margin-bottom: 1em;
}
hr
{
/* tango:aluminium 1 */
color: #d3d7cf;
background: #d3d7cf;
border: none 0px;
height: 1px;
clear: both;
margin: 2.0em 0em 2.0em 0em;
}
dl.toc dt
{
padding-bottom: 0.25em;
}
dl.toc > dt
{
padding-top: 0.25em;
padding-bottom: 0.25em;
font-weight: bold;
}
dl.toc > dl
{
padding-bottom: 0.5em;
}
.parameter
{
font-style: normal;
}
.footer
{
padding-top: 3.5em;
/* tango:aluminium 3 */
color: #babdb6;
text-align: center;
font-size: 80%;
}
.informalfigure,
.figure
{
margin: 1em;
}
.informalexample,
.example
{
margin-top: 1em;
margin-bottom: 1em;
}
.warning
{
/* tango:orange 0/1 */
background: #ffeed9;
background: rgba(252, 175, 62, 0.1);
border-color: #ffb04f;
border-color: rgba(252, 175, 62, 0.2);
}
.note
{
/* tango:chameleon 0/0.5 */
background: #d8ffb2;
background: rgba(138, 226, 52, 0.1);
border-color: #abf562;
border-color: rgba(138, 226, 52, 0.2);
}
div.blockquote
{
border-color: #eeeeec;
}
.note, .warning, div.blockquote
{
padding: 0.5em;
border-width: 1px;
border-style: solid;
margin: 2em;
}
.note p, .warning p
{
margin: 0;
}
div.warning h3.title,
div.note h3.title
{
display: none;
}
p + div.section
{
margin-top: 1em;
}
div.refnamediv,
div.refsynopsisdiv,
div.refsect1,
div.refsect2,
div.toc,
div.section
{
margin-bottom: 1em;
}
/* blob links */
h2 .extralinks, h3 .extralinks
{
float: right;
/* tango:aluminium 3 */
color: #babdb6;
font-size: 80%;
font-weight: normal;
}
.lineart
{
color: #d3d7cf;
font-weight: normal;
}
.annotation
{
/* tango:aluminium 5 */
color: #555753;
font-weight: normal;
}
.structfield
{
font-style: normal;
font-weight: normal;
}
acronym,abbr
{
border-bottom: 1px dotted gray;
}
.listing_frame {
/* tango:sky blue 1 */
border: solid 1px #729fcf;
border: solid 1px rgba(114, 159, 207, 0.2);
padding: 0px;
}
.listing_lines, .listing_code {
margin-top: 0px;
margin-bottom: 0px;
padding: 0.5em;
}
.listing_lines {
/* tango:sky blue 0.5 */
background: #a6c5e3;
background: rgba(114, 159, 207, 0.2);
/* tango:aluminium 6 */
color: #2e3436;
}
.listing_code {
/* tango:sky blue 0 */
background: #e6f3ff;
background: rgba(114, 159, 207, 0.1);
}
.listing_code .programlisting {
/* override from previous */
border: none 0px;
padding: 0px;
background: none;
}
.listing_lines pre, .listing_code pre {
margin: 0px;
}
@media screen {
/* these have a <sup> as a first child, but since there are no parent selectors
* we can't use that. */
a.footnote
{
position: relative;
top: 0em ! important;
}
/* this is needed so that the local anchors are displayed below the naviagtion */
div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
{
display: inline-block;
position: relative;
top:-5em;
}
/* this seems to be a bug in the xsl style sheets when generating indexes */
div.index div.index
{
top: 0em;
}
/* make space for the fixed navigation bar and add space at the bottom so that
* link targets appear somewhat close to top
*/
body
{
padding-top: 2.5em;
padding-bottom: 500px;
max-width: 60em;
}
p
{
max-width: 60em;
}
/* style and size the navigation bar */
table.navigation#top
{
position: fixed;
background: #e2e2e2;
border-bottom: solid 1px #babdb6;
border-spacing: 5px;
margin-top: 0;
margin-bottom: 0;
top: 0;
left: 0;
z-index: 10;
}
table.navigation#top td
{
padding-left: 6px;
padding-right: 6px;
}
.navigation a, .navigation a:visited
{
/* tango:sky blue 3 */
color: #204a87;
}
.navigation a:hover
{
/* tango:sky blue 2 */
color: #3465a4;
}
td.shortcuts
{
/* tango:sky blue 2 */
color: #3465a4;
font-size: 80%;
white-space: nowrap;
}
td.shortcuts .dim
{
color: #babdb6;
}
.navigation .title
{
font-size: 80%;
max-width: none;
margin: 0px;
font-weight: normal;
}
}
@media screen and (min-width: 60em) {
/* screen larger than 60em */
body { margin: auto; }
}
@media screen and (max-width: 60em) {
/* screen less than 60em */
#nav_hierarchy { display: none; }
#nav_interfaces { display: none; }
#nav_prerequisites { display: none; }
#nav_derived_interfaces { display: none; }
#nav_implementations { display: none; }
#nav_child_properties { display: none; }
#nav_style_properties { display: none; }
#nav_index { display: none; }
#nav_glossary { display: none; }
.gallery_image { display: none; }
.property_flags { display: none; }
.signal_flags { display: none; }
.parameter_annotations { display: none; }
.enum_member_annotations { display: none; }
.struct_member_annotations { display: none; }
.union_member_annotations { display: none; }
/* now that a column is hidden, optimize space */
col.parameters_name { width: auto; }
col.parameters_description { width: auto; }
col.struct_members_name { width: auto; }
col.struct_members_description { width: auto; }
col.enum_members_name { width: auto; }
col.enum_members_description { width: auto; }
col.union_members_name { width: auto; }
col.union_members_description { width: auto; }
.listing_lines { display: none; }
}
@media print {
table.navigation {
visibility: collapse;
display: none;
}
div.titlepage table.navigation {
visibility: visible;
display: table;
background: #e2e2e2;
border: solid 1px #babdb6;
margin-top: 0;
margin-bottom: 0;
top: 0;
left: 0;
height: 3em;
}
}
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.hll { background-color: #ffffcc }
.c { color: #3D7B7B; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.cp { color: #9C6500 } /* Comment.Preproc */
.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.gr { color: #E40000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #008400 } /* Generic.Inserted */
.go { color: #717171 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #687822 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #717171; font-weight: bold } /* Name.Entity */
.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #767600 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #666666 } /* Literal.Number.Bin */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sa { color: #BA2121 } /* Literal.String.Affix */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.dl { color: #BA2121 } /* Literal.String.Delimiter */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #A45A77 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.fm { color: #0000FF } /* Name.Function.Magic */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.vm { color: #19177C } /* Name.Variable.Magic */
.il { color: #666666 } /* Literal.Number.Integer.Long */

View File

@@ -0,0 +1,40 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Manual Pages: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="trust-disable.html" title="Disabling the Trust Policy Module">
<link rel="next" href="p11-kit.html" title="p11-kit">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="trust-disable.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="p11-kit.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="tools"></a>Manual Pages</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt>
<span class="refentrytitle"><a href="p11-kit.html">p11-kit</a></span><span class="refpurpose"> — Tool for operating on configured PKCS#11 modules</span>
</dt>
<dt>
<span class="refentrytitle"><a href="pkcs11-conf.html">pkcs11.conf</a></span><span class="refpurpose"> — Configuration files for PKCS#11 modules</span>
</dt>
<dt>
<span class="refentrytitle"><a href="trust.html">trust</a></span><span class="refpurpose"> — Tool for operating on the trust policy store</span>
</dt>
</dl></div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Disabling the Trust Policy Module: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="trust-module.html" title="Trust Policy Module">
<link rel="prev" href="trust-glib-networking.html" title="Using the Trust Policy Module with glib-networking">
<link rel="next" href="tools.html" title="Manual Pages">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="trust-module.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="trust-glib-networking.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="tools.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="trust-disable"></a>Disabling the Trust Policy Module</h2></div></div></div>
<p>This module is installed and enabled by default. It may
be disabled in the following ways:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Use the <code class="option">--disable-trust-module</code>
during the <a class="link" href="devel-building.html#devel-building-configure" title="Extra Configuration Options">p11-kit
build</a>.</p></li>
<li class="listitem"><p>Disable loading trust policy information
from this module by adding a file to <code class="literal">/etc/pkcs11/modules</code>
called <code class="literal">p11-kit-trust.module</code> containing a
<code class="literal">trust-policy: no</code> line.</p></li>
<li class="listitem"><p>Disable this module completely by
adding a file to <code class="literal">/etc/pkcs11/modules</code>
called <code class="literal">p11-kit-trust.module</code> containing a
<code class="literal">enable-in:</code> line (without a value).</p></li>
</ul></div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using the Trust Policy Module with glib-networking: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="trust-module.html" title="Trust Policy Module">
<link rel="prev" href="trust-nss.html" title="Using the Trust Policy Module with NSS">
<link rel="next" href="trust-disable.html" title="Disabling the Trust Policy Module">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="trust-module.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="trust-nss.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="trust-disable.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="trust-glib-networking"></a>Using the Trust Policy Module with glib-networking</h2></div></div></div>
<p>The trust policy module can be used as a source of trust
information for glib-networking's <code class="literal">gnutls-pkcs11</code> backend.
The module provides PKCS#11 trust assertion objects as expected.</p>
<p>The module should work by default if the <code class="literal">gnutls-pkcs11</code>
backend is selected as the glib-networking TLS backend.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,95 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Trust Policy Module: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="index.html" title="p11-kit">
<link rel="prev" href="remoting.html" title="Remoting / Forwarding">
<link rel="next" href="trust-nss.html" title="Using the Trust Policy Module with NSS">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="remoting.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="trust-nss.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="trust-module"></a>Trust Policy Module</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="trust-module.html#trust-files">Paths loaded by the Module</a></span></dt>
<dt><span class="section"><a href="trust-nss.html">Using the Trust Policy Module with NSS</a></span></dt>
<dt><span class="section"><a href="trust-glib-networking.html">Using the Trust Policy Module with glib-networking</a></span></dt>
<dt><span class="section"><a href="trust-disable.html">Disabling the Trust Policy Module</a></span></dt>
</dl></div>
<p>The trust module provides system certificate anchors, blocklists
and other trust policy to crypto libraries applications. This
information is exposed as PKCS#11 objects.</p>
<p>You can use the <a class="link" href="trust.html" title="trust">trust</a> command line
tool to examine and modify the trust policy store.</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="trust-files"></a>Paths loaded by the Module</h2></div></div></div>
<p>The trust module loads certificates and trust policy information
from preconfigured paths and allows them to be looked up via PKCS#11.
The input paths can be determined with using the following command:</p>
<pre class="programlisting">
$ pkg-config --variable p11_trust_paths p11-kit-1
/usr/share/p11-kit/trust:/etc/pki/trust
</pre>
<p>Files in the following formats are supported for loading by the
trust policy module:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">X.509 certificates</span></p></td>
<td><p>X.509 certificates in raw DER format. Does not
automatically contain trust policy information.</p></td>
</tr>
<tr>
<td><p><span class="term">PEM certificates</span></p></td>
<td><p>X.509 certificates in PEM format. These have a
<code class="literal">BEGIN CERTIFICATE</code> header. This file does not
automatically contain trust policy information.</p></td>
</tr>
<tr>
<td><p><span class="term">OpenSSL trust certificates</span></p></td>
<td><p>OpenSSL specific certificates in PEM format
that contain trust information. These have a
<code class="literal">BEGIN TRUSTED CERTIFICATE</code> PEM header. Both
trust anchor and blocklist information can be loaded
from these files.</p></td>
</tr>
</tbody>
</table></div>
<p>If the input path is a file, then it is loaded. Certificate(s) in the
file are automatically treated as anchors, unless they contain alternate
trust policy information.</p>
<p>If the input path is a directory, files inside that directory are
parsed and loaded. If the file contains trust policy information (such as the
OpenSSL trust certificates) then it will be respected. Files without trust policy
information are not automatically marked as an anchor or distrusted.</p>
<p>In addition two optional subdirectories of the input path are loaded. Files
placed in the <code class="literal">anchors/</code> subdirectory become trust anchors
when they do not contain trust policy information. Files placed in the
<code class="literal">blocklist/</code> subdirectory are distrusted whether they
contain trust information or not.</p>
<p>The first input path becomes the first PKCS#11 token of the trust
module, and has the highest priority when callers search for trust
policy information.</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,40 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using the Trust Policy Module with NSS: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="trust-module.html" title="Trust Policy Module">
<link rel="prev" href="trust-module.html" title="Trust Policy Module">
<link rel="next" href="trust-glib-networking.html" title="Using the Trust Policy Module with glib-networking">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="trust-module.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="trust-module.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="trust-glib-networking.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="trust-nss"></a>Using the Trust Policy Module with NSS</h2></div></div></div>
<p>The trust policy module is a drop in replacement for the
<code class="literal">libnssckbi.so</code> module and thus works out of
the box with NSS. The trust policy module provides NSS style
PKCS#11 trust objects for NSS to retrieve.</p>
<p>The module may be used to replace the
<code class="literal">libnssckbi.so</code> file via an distribution
specific alternatives mechanism or otherwise.</p>
<p>Alternatively NSS applications like Firefox or Thunderbird
may be configured to use the trust policy module by adding
the <code class="literal">p11-kit-trust.so</code> PKCS#11 module via their
GUI or command line configuration.</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

View File

@@ -0,0 +1,440 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>trust: p11-kit</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="p11-kit">
<link rel="up" href="tools.html" title="Manual Pages">
<link rel="prev" href="pkcs11-conf.html" title="pkcs11.conf">
<link rel="next" href="reference.html" title="API Reference">
<meta name="generator" content="GTK-Doc V1.34.0 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="tools.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="pkcs11-conf.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="reference.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="trust"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">trust</span></h2>
<p>trust — Tool for operating on the trust policy store</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p><code class="command">trust list</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">trust extract</code> --filter=&lt;what&gt; --format=&lt;type&gt; /path/to/destination
</p></div>
<div class="cmdsynopsis"><p><code class="command">trust anchor</code> /path/to/certificate.crt
</p></div>
<div class="cmdsynopsis"><p><code class="command">trust dump</code> </p></div>
<div class="cmdsynopsis"><p><code class="command">trust check-format</code> /path/to/file.p11-kit...
</p></div>
</div>
<div class="refsect1">
<a name="trust-description"></a><h2>Description</h2>
<p><span class="command"><strong>trust</strong></span> is a command line tool to examine and
modify the shared trust policy store.</p>
<p>See the various sub commands below. The following global options
can be used:</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">-v, --verbose</code></span></p></td>
<td><p>Run in verbose mode with debug
output.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">-q, --quiet</code></span></p></td>
<td><p>Run in quiet mode without warning or
failure messages.</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="trust-list"></a><h2>List</h2>
<p>List trust policy store items.</p>
<pre class="programlisting">
$ trust list
</pre>
<p>List information about the various items in the trust policy store.
Each item is listed with it's PKCS#11 URI and some descriptive information.</p>
<p>You can specify the following options to control what to list.</p>
<dt><span class="term"><code class="option">--filter=&lt;what&gt;</code></span></dt>
<dd>
<p>Specifies what certificates to extract. You can specify the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">ca-anchors</code></span></p></td>
<td><p>Certificate anchors</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">trust-policy</code></span></p></td>
<td><p>Anchors and blocklist (default)</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">blocklist</code></span></p></td>
<td><p>Distrusted certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">certificates</code></span></p></td>
<td><p>All certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pkcs11:object=xx</code></span></p></td>
<td><p>A PKCS#11 URI to filter with</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p>If an output format is chosen that cannot support type what has been
specified by the filter, a message will be printed.</p>
<p>None of the available formats support storage of blocklist entries
that do not contain a full certificate. Thus any certificates distrusted by
their issuer and serial number alone, are not included in the extracted
blocklist.</p>
</dd>
<dt><span class="term"><code class="option">--purpose=&lt;usage&gt;</code></span></dt>
<dd>
<p>Limit to certificates usable for the given purpose
You can specify one of the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">server-auth</code></span></p></td>
<td><p>For authenticating servers</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">client-auth</code></span></p></td>
<td><p>For authenticating clients</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">email</code></span></p></td>
<td><p>For email protection</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">code-signing</code></span></p></td>
<td><p>For authenticated signed code</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">1.2.3.4.5...</code></span></p></td>
<td><p>An arbitrary purpose OID</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</dd>
</div>
<div class="refsect1">
<a name="trust-anchor"></a><h2>Anchor</h2>
<p>Store or remove trust anchors.</p>
<pre class="programlisting">
$ trust anchor /path/to/certificate.crt
$ trust anchor --remove /path/to/certificate.crt
$ trust anchor --remove "pkcs11:id=%AA%BB%CC%DD%EE;type=cert"
</pre>
<p>Store or remove trust anchors in the trust policy store. These are
usually root certificate authorities.</p>
<p>Specify either the <code class="option">--store</code> or <code class="option">--remove</code>
operations. If no operation is specified then <code class="option">--store</code> is
assumed.</p>
<p>When storing, one or more certificate files are expected on the
command line. These are stored as anchors, unless they are already
present.</p>
<p>When removing an anchor, either specify certificate files or
PKCS#11 URI's on the command line. Matching anchors will be removed.</p>
<p>It may be that this command needs to be run as root in order to
modify the system trust policy store, if no user specific store is
available.</p>
<p>You can specify the following options.</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--remove</code></span></p></td>
<td><p>Remove one or more anchors from the trust
policy store. Specify certificate files or PKCS#11 URI's
on the command line.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--store</code></span></p></td>
<td><p>Store one or more anchors to the trust
policy store. Specify certificate files on the command
line.</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="trust-extract"></a><h2>Extract</h2>
<p>Extract trust policy from the shared trust policy store.</p>
<pre class="programlisting">
$ trust extract --format=x509-directory --filter=ca-anchors /path/to/directory
</pre>
<p>You can specify the following options to control what to extract.
The <code class="option">--filter</code> and <code class="option">--format</code> arguments
should be specified. By default this command will not overwrite the
destination file or directory.</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">--comment</code></span></p></td>
<td><p>Add identifying comments to PEM bundle output files
before each certificate.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--filter=&lt;what&gt;</code></span></p></td>
<td>
<p>Specifies what certificates to extract. You can specify the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">ca-anchors</code></span></p></td>
<td><p>Certificate anchors (default)</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">trust-policy</code></span></p></td>
<td><p>Anchors and blocklist</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">blocklist</code></span></p></td>
<td><p>Distrusted certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">certificates</code></span></p></td>
<td><p>All certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pkcs11:object=xx</code></span></p></td>
<td><p>A PKCS#11 URI</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p>If an output format is chosen that cannot support type what has been
specified by the filter, a message will be printed.</p>
<p>None of the available formats support storage of blocklist entries
that do not contain a full certificate. Thus any certificates distrusted by
their issuer and serial number alone, are not included in the extracted
blocklist.</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--format=&lt;type&gt;</code></span></p></td>
<td>
<p>The format of the destination file or directory.
You can specify one of the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">x509-file</code></span></p></td>
<td><p>DER X.509 certificate file</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">x509-directory</code></span></p></td>
<td><p>directory of X.509 certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pem-bundle</code></span></p></td>
<td><p>File containing one or more certificate PEM blocks</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pem-directory</code></span></p></td>
<td><p>Directory of PEM files each containing one certificate</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pem-directory-hash</code></span></p></td>
<td><p>Directory of PEM files each containing one certificate, with hash symlinks</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">openssl-bundle</code></span></p></td>
<td><p>OpenSSL specific PEM bundle of certificates</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">openssl-directory</code></span></p></td>
<td><p>Directory of OpenSSL specific PEM files</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">java-cacerts</code></span></p></td>
<td><p>Java keystore 'cacerts' certificate bundle</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--overwrite</code></span></p></td>
<td><p>Overwrite output file or directory.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--purpose=&lt;usage&gt;</code></span></p></td>
<td>
<p>Limit to certificates usable for the given purpose
You can specify one of the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">server-auth</code></span></p></td>
<td><p>For authenticating servers</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">client-auth</code></span></p></td>
<td><p>For authenticating clients</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">email</code></span></p></td>
<td><p>For email protection</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">code-signing</code></span></p></td>
<td><p>For authenticated signed code</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">1.2.3.4.5...</code></span></p></td>
<td><p>An arbitrary purpose OID</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="trust-extract-compat"></a><h2>Extract Compat</h2>
<p>Extract compatibility trust certificate bundles.</p>
<pre class="programlisting">
$ trust extract-compat
</pre>
<p>OpenSSL, Java and some versions of GnuTLS cannot currently read
trust information directly from the trust policy store. This command
extracts trust information such as certificate anchors for use by
these libraries.</p>
<p>What this command does, and where it extracts the files is
distribution or site specific. Packagers or administrators are expected
customize this command.</p>
</div>
<div class="refsect1">
<a name="trust-dump"></a><h2>Dump</h2>
<p>Dump PKCS#11 items in the various tokens.</p>
<pre class="programlisting">
$ trust dump
</pre>
<p>Dump information about the various PKCS#11 items in the tokens.
Each item is dumped with it's PKCS#11 URI and information in the .p11-kit
persistence format.</p>
<p>You can specify the following options to control what to dump.</p>
<dt><span class="term"><code class="option">--filter=&lt;what&gt;</code></span></dt>
<dd>
<p>Specifies what certificates to extract. You can specify the following values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="option">all</code></span></p></td>
<td><p>All objects. This is the default</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">pkcs11:object=xx</code></span></p></td>
<td><p>A PKCS#11 URI to filter with</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</dd>
</div>
<div class="refsect1">
<a name="trust-check-format"></a><h2>Check Format</h2>
<p>Check the format of .p11-kit files.</p>
<pre class="programlisting">
$ trust check-format /path/to/file.p11-kit...
</pre>
<p>Administrators sometimes need to write a custom .p11-kit file to amend
the trust information. This is an error prone process as the file format is
mainly for machine processing. Administrators can use this command to check
whether a file has a correct .p11-kit format.</p>
<p>This command takes an arbitrary number of files as an input. Each file
is then analysed and any mismatch with the .p11-kit format is reported on the
standard error output. After the file is processed a check result is printed
on the standard output.</p>
</div>
<div class="refsect1">
<a name="trust-bugs"></a><h2>Bugs</h2>
<p>
Please send bug reports to either the distribution bug tracker
or the upstream bug tracker at
<a class="ulink" href="https://github.com/p11-glue/p11-kit/issues/" target="_top">https://github.com/p11-glue/p11-kit/issues/</a>.
</p>
</div>
<div class="refsect1">
<a name="trust-see-also"></a><h2>See also</h2>
<span class="simplelist"><span class="citerefentry"><span class="refentrytitle">p11-kit</span>(8)</span></span><p>An explanatory document about storing trust policy:
<a class="ulink" href="https://p11-glue.github.io/p11-glue/doc/storing-trust-policy/" target="_top">https://p11-glue.github.io/p11-glue/doc/storing-trust-policy/</a></p>
<p>
Further details available in the p11-kit online documentation at
<a class="ulink" href="https://p11-glue.github.io/p11-glue/p11-kit/manual/" target="_top">https://p11-glue.github.io/p11-glue/p11-kit/manual/</a>.
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B