osslsigncode with the Infisical PKCS#11 module. osslsigncode is a cross-platform tool that lets you sign Windows binaries from Linux and macOS, making it ideal for CI/CD pipelines that don’t run on Windows.
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
osslsigncode2.5 or later (includes native PKCS#11 support)
Step 1: Install osslsigncode and Dependencies
- Ubuntu / Debian
- macOS (Homebrew)
- Build from source
Step 2: Identify Your Signer
Usepkcs11-tool to list available signers and note the token label:
Step 3: Sign a Windows Executable
Useosslsigncode with the PKCS#11 module to sign your binary:
-pkcs11module: Path to the Infisical PKCS#11 shared library.-pkcs11certand-key: PKCS#11 URI referencing your signer by name. Replacerelease-signerwith your signer name.-h sha256: Hash algorithm for the signature digest.-n: Description embedded in the signature (shown in Windows UAC prompts).-i: URL for more information about the publisher.-t: Timestamp server URL. Timestamping ensures the signature remains valid after your certificate expires.
Supported File Types
osslsigncode can sign the following Windows artifact types:| Type | Extensions |
|---|---|
| Executables | .exe, .dll, .sys, .ocx |
| Installers | .msi, .msix, .appx |
| Cabinet files | .cab |
| Scripts | .ps1, .vbs |
| Catalogs | .cat |
Step 4: Verify the Signature
Verify the signed binary: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.
Key not found or signing errors
Key not found or signing errors
Verify the object name in the PKCS#11 URI matches your signer name exactly and that you have an active signing grant. You can list available signers with
pkcs11-tool --module /path/to/lib --list-slots.Certificate not found in PKCS#11
Certificate not found in PKCS#11
The
-pkcs11cert URI must match your signer name exactly. Use pkcs11-tool --module /path/to/lib --list-objects --type cert to verify available certificate labels.