- Set Futurex PKCS #11 environment variables.
- Create a key pair on the CryptoHub by using pkcs11-tool.
- Generate a CSR by using the NGINX private key.
- Create a self-signed root certificate authority.
- Sign the NGINX CSR.
- Combine the NGINX and CA certificates into a single file.
- Configure NGINX to use the certificate and its associated private key stored in CryptoHub.
- Confirm NGINX uses the new TLS certificate and private key (stored on the CryptoHub) for HTTPS connections.
Set environment variables
Perform the following to set Futurex PKCS #11 environment variables:1
In a terminal, run the following commands to set the required FXPKCS11 environment variables:
Shell
Be sure to modify the file path to match the location where
libfxpkcs11.so and fxpkcs11.cfg files are stored on your system.Create a key pair
Perform the following steps to create a key pair on the CryptoHub by using pkcs11-tool:1
In a terminal, run the following command to create a new ECC key pair on the CryptoHub:The preceding pkcs11-tool command prompts for the user PIN. Enter the CryptoHub identity password configured inside the
Text
<CRYPTO-OPR-PASS> tag in the fxpkcs11.cfg file.If successful, the command output displays the keys that pkcs11-tool created on the CryptoHub.
Generate a CSR
Perform the following steps to generate a CSR by using the NGINX private key:1
In a terminal, run the following command to generate a CSR from the private key created on the CryptoHub for NGINX by using pkcs11-tool.
Text
The Common Name of the NGINX certificate should match the IP address or hostname of the virtual host it is configured for.
Create a CA
This step creates and uses a self-signed root certificate authority (CA) for demonstration. In a production environment, you should use a secure certificate authority, such as the KMES Series 3, for all private key generation and certificate signing operations.
1
In a terminal, run the following commands to generate a root private key and self-signed certificate.
Text
Sign the CSR
Perform the following steps to sign the NGINX CSR:1
In a terminal, run the following command to issue a signed NGINX certificate by using the self-signed root CA created in the previous step.
Text
The Common Name must be the IP address or hostname of the NGINX server.
Combine the certificates
To combine the NGINX and CA certificates into a single file, run the following commands in a terminal to combine the NGINX and CA certificates into a singlePEM file:
Text
Configure NGINX
This section covers how to modify the configuration file for an NGINX virtual host. Configuration of a virtual host is outside the scope of this guide. Refer to this documentation specific to your operating system if you have not configured a virtual host. Perform the following steps to configure NGINX to use the certificate and its associated private key stored in CryptoHub:1
Before making any changes, stop your NGINX server by using the following commands:
Text
2
The latest version ofNginx(as of September 2025) doesn’t support using URI to attain keys using OpenSSL Provider architecture in the uri2pem.py webiste:https://github.com/latchset/pkcs11-provider/blob/1362378ad3d5f40013bae7562cf7e5d79149925e/tools/uri2pem.pySet up a Python virtual environment and download the necessary libraries for this script to work:Afterwards, use the following commands to make sure they both point to Run the following commands to install the needed Python library, and the script with the URI:
.conf file. Luckily, pkcs11-provider by Latchset has a workaround by using a .pem file with URI information enclosed to attain the private key that is stored on CryptoHub.
Visit the following site and download the Python file uri2pem.py.ImportantFuturex will provide support for all other aspects of the integration; however, this script is not maintained by Futurex, and we cannot guarantee its functionality or offer troubleshooting support related to it.
Shell
~/projects/uri2pem/.venv/Shell
Shell
3
In a text editor, open the configuration file inside the
conf.d/ folder in the NGINX directory for the virtual host you want to configure HTTPS for, and modify it as shown in the following example:Text
You must update the paths in
sslcertificateand sslcertificate_key to point to the signed NGINX certificate and the NGINX private key PEM file, which was generated earlier with Python, as stored on your system.4
Check if the NGINX configuration files for syntax errors and validity with the following command:Restart your NGINX server with the following command:
Shell
If there are no issues, the output should look something similar to:
None
Shell
Confirm NGINX configuration
You can complete the following steps with the Firefox web browser. There might be some differences in the actions when using a different browser, but the overall process is the same. Perform the following steps to confirm NGINX uses the new TLS certificate and private key (stored on the CryptoHub) for HTTPS connections:1
Browse to the IP address of the NGINX website that is running over HTTPS.
You should see a lock icon to the left of the web address.
2
View the certificate that the website served to the browser and confirm it is the certificate configured for the NGINX server.

