libp11 engine. OpenSSL is a versatile foundation for signing any file format. It is useful when you need raw signatures, custom signing pipelines, or integration with tools that wrap OpenSSL.
Prerequisites
- An Infisical project with a signer configured
- An active signing grant for the signer
- A machine identity with Universal Auth and
Signpermission on the signer - The Infisical PKCS#11 module installed and configured
- OpenSSL 1.1.1 or later
libp11(OpenSSL PKCS#11 engine)
Step 1: Install the PKCS#11 Engine
- Ubuntu / Debian
- macOS (Homebrew)
- RHEL / Fedora
Step 2: Create an OpenSSL Configuration
Create an OpenSSL config fileinfisical-openssl.cnf to set up the PKCS#11 engine:
Step 3: Sign a File
Sign a file using the PKCS#11 key. The same command works for both RSA and ECDSA keys. OpenSSL automatically selects the correct algorithm based on the key type:- The
objectin the PKCS#11 URI must match your signer name exactly. - The output is a raw signature file (PKCS#1 for RSA, DER-encoded for ECDSA).
Sign with RSA-PSS Padding
For RSA keys, you can use PSS padding instead of the default PKCS#1 v1.5:RSA-PSS requires the signer’s key to support the
RSASSA_PSS mechanism. This is only available with RSA keys.Step 4: Verify the Signature
Extract the public key or certificate from PKCS#11, then verify:Common Use Cases
Sign a Checksum Manifest
Create a Detached S/MIME Signature
CI/CD Integration
Troubleshooting
For any issue, enable debug logging in your config file ("log_level": "debug", "log_file": "/tmp/infisical-pkcs11.log") to get detailed output.
Engine 'pkcs11' not found or key errors
Engine 'pkcs11' not found or key errors
Ensure
libp11 is installed and the object name in the PKCS#11 URI matches your signer name exactly. Check the engine is registered with openssl engine -t pkcs11.OpenSSL 3.0+ deprecation warnings
OpenSSL 3.0+ deprecation warnings
OpenSSL 3.0 deprecated engines in favor of providers. The
libp11 engine still works but may show warnings. For a provider-based approach, use pkcs11-provider instead.