docs/documentation/platform/pki/code-signing/guides/pkcs11-osslsigncode.mdx
In the following steps, we explore how to sign Windows Authenticode artifacts using 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.
Sign permission on the signerosslsigncode 2.5 or later (includes native PKCS#11 support)Use pkcs11-tool to list available signers and note the token label:
pkcs11-tool --module /usr/local/lib/libinfisical-pkcs11.so --list-slots
Available slots:
Slot 0 (0x0): release-signer
token label : release-signer
token manufacturer : Infisical
Use osslsigncode with the PKCS#11 module to sign your binary:
osslsigncode sign \
-pkcs11module /usr/local/lib/libinfisical-pkcs11.so \
-pkcs11cert "pkcs11:object=release-signer;type=cert" \
-key "pkcs11:object=release-signer;type=private" \
-h sha256 \
-n "My Application" \
-i "https://example.com" \
-t http://timestamp.digicert.com \
-in MyApp.exe \
-out MyApp-signed.exe
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 |
Verify the signed binary:
osslsigncode verify MyApp-signed.exe
The output confirms the signature is valid:
Signature verification: ok
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
osslsigncode sign \
-pkcs11module /usr/local/lib/libinfisical-pkcs11.so \
-pkcs11cert "pkcs11:object=release-signer;type=cert" \
-key "pkcs11:object=release-signer;type=private" \
-h sha256 \
-n "My Application" \
-t http://timestamp.digicert.com \
-in MyApp.exe \
-out MyApp-signed.exe
For any issue, enable debug logging in your config file ("log_level": "debug", "log_file": "/tmp/infisical-pkcs11.log") to get detailed output.