PKCS#11 Configuration
Consistent configuration
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.
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.
Module Configuration
Each configured PKCS#11 module has its own config file. The
location(s) of these files are described below. Most importantly each
config file specifies the location of the PKCS#11 module to load. Each
module config file has the following fields:
module:
The absolute path to the PKCS#11 module to load.
This should include an extension like .so
Other fields may be present, but it is recommended that field names
that are not specified in this document start with a x-
prefix.
Global Configuration
A global configuration is also 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:
user-config:
This will be equal to one of the following values:
none, merge,
only.
Other fields may be present, but it is recommended that field names
that are not specified in this document start with a x-
prefix.
Configuration Files
Each configured PKCS#11 module is 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.
The system global configuration file is in
/etc/pkcs11/pkcs11.conf and the user global
configuration file is in ~/.pkcs11/pkcs11.conf in the
user's home directory.
The module config files are located in the
/etc/pkcs11/modules directory, with one configuration
file per module. In addition the ~/.pkcs11/modules
directory can be used for modules installed by the user.