Add Windows Authenticode signing support with PKCS#11 HSM#431
Merged
Add Windows Authenticode signing support with PKCS#11 HSM#431
Conversation
Add WindowsSigningService that signs Windows EXEs with Authenticode signatures, supporting PFX/JKS keystores and PKCS#11 HSM tokens. Configuration is driven by environment variables (JDEPLOY_WIN_*). Signing is automatically applied during Windows bundling in PackageService when signing env vars are present. https://claude.ai/code/session_01Fh1FJsRT8MXrqZMuniWbwR
…SoftHSM2 Adds two integration test classes: - WindowsSigningPfxIntegrationTest: tests signing with a self-signed PFX keystore (requires only keytool) - WindowsSigningPkcs11IntegrationTest: tests signing through PKCS#11 using SoftHSM2 as a software HSM, exercising the same code path as Azure Key Vault and AWS CloudHSM Both tests auto-skip when prerequisites are missing. Includes a CI setup script for installing SoftHSM2. https://claude.ai/code/session_01Fh1FJsRT8MXrqZMuniWbwR
Add missing WindowsSigningService and WindowsSigningConfigFactory mock parameters to PackageServiceIntegrationTest and GitHubPublishDriverIntegrationTest. https://claude.ai/code/session_01Fh1FJsRT8MXrqZMuniWbwR
The minimal PE had incorrect data directory layout — NumberOfRvaAndSizes was written at the wrong offset (0x10C instead of 0xEC), causing the certificate table entry to not be recognized by jsign. Rebuilt the PE with correct PE32 optional header field offsets, proper section headers, and section data. https://claude.ai/code/session_01Fh1FJsRT8MXrqZMuniWbwR
shannah
pushed a commit
that referenced
this pull request
Mar 15, 2026
Documents the black-box specification for the Authenticode signing support added in PR #431, including environment variable configuration, supported keystore types (PFX, JKS, PKCS#11), and usage examples. https://claude.ai/code/session_01Vwovc4eQee9KZ5LmUSJyqv
shannah
added a commit
that referenced
this pull request
Mar 15, 2026
Documents the black-box specification for the Authenticode signing support added in PR #431, including environment variable configuration, supported keystore types (PFX, JKS, PKCS#11), and usage examples. https://claude.ai/code/session_01Vwovc4eQee9KZ5LmUSJyqv Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive Windows Authenticode signing capabilities to jdeploy, supporting both local keystores (PFX/JKS) and PKCS#11 hardware security modules (HSMs). This enables code signing for Windows executables during the packaging process, with support for real HSMs (SafeNet, YubiKey) and cloud HSM services via PKCS#11.
Key Changes
JDEPLOY_WIN_*), enabling CI/CD integration without code changesWindowsSigningPfxIntegrationTest: Tests signing with self-signed PFX certificates, including in-place signing, separate output file, and auto-alias detectionWindowsSigningPkcs11IntegrationTest: Tests PKCS#11 signing path using SoftHSM2, verifying the same code path used by real HSMssofthsm2-test-setup.shfor CI environments to install SoftHSM2 and OpenSC prerequisitesNotable Implementation Details
KeyStoreBuilderinterface, making it compatible with any PKCS#11 provider (hardware HSMs, cloud HSMs, SoftHSM2)Assumptions.assumeTrue()to gracefully skip when prerequisites (keytool, softhsm2-util) are unavailableJDEPLOY_WIN_*pattern for discoverabilityhttps://claude.ai/code/session_01Fh1FJsRT8MXrqZMuniWbwR