Skip to content

Add Windows Authenticode signing support for bundle publishing#444

Merged
shannah merged 9 commits intomasterfrom
claude/add-authenticode-signing-R6YwK
Mar 15, 2026
Merged

Add Windows Authenticode signing support for bundle publishing#444
shannah merged 9 commits intomasterfrom
claude/add-authenticode-signing-R6YwK

Conversation

@shannah
Copy link
Copy Markdown
Owner

@shannah shannah commented Mar 15, 2026

Summary

This PR adds comprehensive Windows Authenticode code signing support to jDeploy's bundle publishing workflow. Windows executables can now be automatically signed during the publish process using certificates stored locally or on hardware security modules (HSMs).

Key Changes

  • PublishBundleService: Integrated Windows signing into the bundle build pipeline

    • Added WindowsSigningService and WindowsSigningConfigFactory dependencies
    • Calls signWindowsExeIfConfigured() after building Windows exe bundles (both GUI and CLI variants)
    • Signing failures are non-fatal and logged as warnings to allow builds to continue
  • GitHub Action Integration (action.yml):

    • Added 10 new inputs for Windows signing configuration (certificate, password, keystore type, PKCS#11 config, key alias, timestamp URL, hash algorithm, description, URL)
    • New "Set Up Windows Authenticode Signing" step that:
      • Decodes base64-encoded PFX certificates to temporary files
      • Maps action inputs to environment variables (JDEPLOY_WIN_*)
      • Supports both local PKCS#12 certificates and PKCS#11 HSM signing
    • New cleanup step that removes decoded certificate files after workflow completion
  • Documentation (windows-authenticode-signing.md):

    • Added comprehensive GitHub Action integration guide with examples
    • Documented all action inputs and their mappings
    • Provided examples for local PFX certificates and PKCS#11/HSM signing
    • Added security notes about secret management and certificate cleanup
  • Test Coverage:

    • Added 6 new integration tests in BundlePublishMockNetworkTest:
      • Full end-to-end flow with signing enabled
      • Verification that signing is skipped when not configured
    • Added 5 new unit tests in PublishBundleServiceTest:
      • Signing of Windows exe bundles when configured
      • Non-signing of non-Windows platforms
      • Skipping signing when no configuration present
      • Signing both GUI and CLI bundles
      • Graceful handling of signing failures

Implementation Details

  • Signing is activated only when WindowsSigningConfigFactory.createFromEnvironment() returns a non-null config
  • Only .exe files are signed; other bundle formats are skipped
  • Both GUI and CLI Windows bundles are signed when applicable
  • Signing exceptions are caught and logged as warnings to prevent build failures
  • The GitHub Action automatically cleans up decoded certificates from ${{ runner.temp }}
  • Supports multiple keystore types: PKCS#12 (default), JKS, and PKCS#11 (for HSM)

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC

claude and others added 9 commits March 15, 2026 13:18
Add optional inputs for configuring Windows code signing via environment
variables. When win_signing_certificate is provided, the base64-encoded
PFX is decoded to a temp file and JDEPLOY_WIN_* env vars are set for
the packaging steps. Certificate is cleaned up after the action completes.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
Add win_signing_keystore_type and win_signing_pkcs11_config inputs to
support HSM-based Authenticode signing in addition to local PFX
certificates. The setup step now triggers when either
win_signing_certificate or win_signing_pkcs11_config is provided.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
Document all action inputs, usage examples for PFX and PKCS#11/HSM
signing, and security notes for handling certificates in CI.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
PublishBundleService.buildBundles() was calling Bundler.runit() directly
to create pre-built bundles, bypassing the Authenticode signing in
PackageService. At install time, the pre-built bundle replaced the
locally-built exe, resulting in an unsigned app on the user's machine.

Inject WindowsSigningService and WindowsSigningConfigFactory into
PublishBundleService and sign Windows exe files after building and
before wrapping into tar.gz archives.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
Add 5 unit tests to PublishBundleServiceTest:
- Signs Windows exe bundles when signing is configured
- Does not sign non-Windows bundles
- Skips signing when no config is present
- Signs both GUI and CLI Windows bundles
- Continues on signing failure (non-fatal)

Add 2 mock network integration tests to BundlePublishMockNetworkTest:
- Full prepare flow signs Windows exe in pre-built bundles
- Full prepare flow skips signing when not configured

These tests use a real PublishBundleService with mocked signing services
and mocked Bundler.runit() to verify the fix for unsigned pre-built
Windows bundles.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
…nature

jsign 7.0 stripped self-signed certificates from the PKCS7 certificate
store embedded in the Authenticode signature. This caused Windows to
report "certificate for the signer is invalid or not found" because the
signer's certificate was missing from the signature, even though the
signature itself was correctly applied.

jsign 7.3 includes the fix: "Self-signed certificates are no longer
removed from the certificate store embedded in the signature."

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
The mock-network-tests workflow built shared and installer modules
individually but never installed the parent POM into the local Maven
repo. When the installer module resolved jdeploy-shared as a dependency,
Maven couldn't find jdeploy-parent:pom:1.0-SNAPSHOT.

Add `mvn -N install` step to install the parent POM first.

https://claude.ai/code/session_01911Jm72yb9Ph2WK9nP36hC
@shannah shannah merged commit 545f270 into master Mar 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants