Guide to install and configure pkcs11-provider for OpenSSL, targeting developers.
This section describes how to install and configure pkcs11-provider from Latchset for the OpenSSL library. The following list provides an overview of pkcs11-provider library:
Library
Description
pkcs11-provider
An OpenSSL 3.x cryptographic provider that enables access to cryptographic tokens—such as smart cards and Hardware Security Modules (HSMs)—through the standard PKCS#11 API. It acts as a bridge between OpenSSL’s provider-based architecture and any PKCS#11-compliant module.
Instructions for installing pkcs11-provider depend on the Linux version being used.Perform the following instructions to install pkcs11-provider on the supported operating systems:
Perform the following steps to install pkcs11-provider on Ubuntu 24.04 or Debian 13:
While aptcan install the minimum required version (v0.3) of pkcs11-provider, it’s recommended to compile it from source to ensure you’re using the latest version. This helps avoid compatibility issues and ensures access to the most recent features and bug fixes.
Perform the following steps to edit the OpenSSL configuration file for Ubuntu or Debian-based Linux distributions and Red Hat or CentOS-based distributions:
1
Run the following command to determine the location of the global OpenSSL configuration file for the logged-in user:
Shell
openssl version -d
2
Open the openssl.cnf file in a text editor with root privileges.
3
Add the following line at the top of the file, before any sections, if it is not already present:
None
openssl_conf = openssl_init
4
Add the following text, based on your operating system, at the bottom of the file after modifying the module and pkcs11-module-path:
If you need automatic logging to the token, specify the PIN by adding the following line:pkcs11-module-token-pin = file:/path/to/filewithpin.txtThe file referenced should contain just the PIN.
5
Test if OpenSSL successfully loaded the provider.
Shell
openssl list -providers
If successful, both default and pkcs11 should be listed under providers.
Was this page helpful?
⌘I
Assistant
Responses are generated using AI and may contain mistakes.