Install on Ubuntu or Debian
1
Install the required packages:
Shell
2
Create a source directory and change into it:
Shell
3
Clone the pkcs11-provider repository:
Shell
4
Build the provider:
Shell
5
Install the provider:Example output:In this example,
Shell
During installation, the
pkcs11.so module is copied to the OpenSSL modules directory. You’ll need this path when updating the OpenSSL configuration file.Shell
pkcs11.so is installed in /usr/lib/x86_64-linux-gnu/ossl-modules.Install on RHEL
1
Enable CodeReady Builder (CRB):RHEL 8:RHEL 9:Alma and Rocky Linux 8:Alma and Rocky Linux 9:
Shell
Shell
Shell
Shell
2
Install the EPEL Release package:
Shell
3
Refresh metadata:
Shell
4
Install prerequisites:
Shell
5
Change to a source directory:
Shell
6
Clone the repository:
Shell
7
Build the provider:
Shell
8
Install the provider:Example output:In this example,
Shell
During installation, the
pkcs11.so module is copied to the OpenSSL modules directory. You’ll need this path when updating the OpenSSL configuration file.Shell
pkcs11.so is installed in /usr/lib64/ossl-modules.The
pkcs11-tool command for listing tokens may not function correctly on Rocky Linux 9 with pkcs11-provider. This is a known limitation and does not affect HSM functionality. Token verification works as expected on Rocky Linux 10.Configure OpenSSL to load the provider
1
Locate the OpenSSL configuration file. You can verify it using the following command
openssl version -d. For instance:- For Ubuntu/Debian:
Shell
- For RHEL:
Shell
2
Create a backup of the OpenSSL configuration file before making changes:
Shell
3
Open the OpenSSL configuration file for editing:
Shell
4
At the top of the file, add the following line if it’s not already present:
Configuration
5
At the bottom of the file, add the following configuration block. Update the paths as needed for your system:
Configuration
6
Save and exit the file — Ctrl-X, Y, then Enter.
7
Verify that the PKCS #11 provider loads correctly:
Shell
- You should see both
defaultandpkcs11listed. - Example output:
Shell

