Thank you for sharing the details.
your setup with Google Cloud KMS and jsign is impressive! You're absolutely right: signing ClickOnce manifest files is a bit more complicated due to the format and the limitations of tools like SignTool and Mage, which expect access to a .pfx file or a certificate in the local store.
The Core Issue
jsign doesn't support .application or .manifest files.
SignTool and Mage require a .pfx or a cert in the Windows cert store.
Google Cloud KMS keeps the private key non-exportable, so .pfx creation is off the table.
Possible Workarounds
- Use Google Cloud KMS CNG Provider
Google offers a CNG provider that allows SignTool to access KMS-backed keys directly. You’ll need:
The latest Windows SDK (for SignTool)
The Google Cloud KMS CNG provider installed
Your certificate imported into the Windows cert store (without the private key)
Then you can use SignTool like this:
powershell
signtool sign /v /fd sha256 /csp "Google Cloud KMS Provider" /kc <KMS key path> <artifact>
However, this still won’t help with .manifest files unless Mage can also use the CNG provider—which it currently doesn’t.
- Custom Signing Workflow
Since Mage requires a .pfx, consider creating a custom signing tool that:
Uses the Google Cloud KMS API to sign the manifest hash
Injects the signature manually into the manifest XML
This is advanced, but doable. You’d need to:
Extract the hash from the manifest
Sign it using the KMS asymmetric key via the API
Embed the signature back into the manifest
- Hybrid CI/CD Pipeline
If you’re using a CI/CD system like Azure DevOps or GitHub Actions:
Use a self-hosted agent with access to the KMS key
Use a script like SignClickOnceApp.ps1 to sign the .exe with SignTool and the manifest with Mage
Modify the script to call Google Cloud KMS for signing instead of using a .pfx
Let us know if the issue persists after following these steps. We’ll be happy to assist further if needed. If the issue has been resolved, kindly mark the response as answered."