Reputation: 450
Got a question regarding click once signing.
I have a server with Jenkins on it, which handles building a WPF application with ClickOnce as a deployment option. I have used a set of commands for MSBuild and mage.exe to produce an application file with deployment and application manifests signed by a provided *.pfx file.
Now the decision was made that the pfx file will not be provided. Instead, all keys were moved to the Azure Key Vault.
My question is - what will be a correct flow to make manifest signing for the ClickOnce application work with Azure Key Vault? I just don't understand how to execute the mage -update correctly with no path to provide as -certfile argument.
Thank's in advance.
Upvotes: 1
Views: 1793
Reputation: 450
Just to give an update on situation in 2024/2025 when it is unlikelyl that the IT will get you the EV codesign certificate on a build server in cert store.
Give:
In order to sign the published clickonce application having this info:
sign code azure-key-vault "{YOUR_PUBLISH_FOLDER}\{YOUR_APP_NAME}.application" --azure-key-vault-url "{YOUR_KEY_VAULT_URL}" --azure-key-vault-certificate "{YOUR_CERTIFICATE_NAME}" --application-name "{YOUR_APP_NAME}" --publisher-name "{YOUR_PUBLISHER_NAME}" --timestamp-url "http://timestamp.digicert.com/"
This worked for me surprisingly well, since it figured out what to sign automatically and there is no need to rename/sign on build dll's now. Shame it took quite some time to figure out, since there is no example in documentation. Also, I don't know how to make it work when all parameters specified explicitly (without environment variables), since it brags that
The client secret options are obsolete and should no longer be specified.
Upvotes: 0
Reputation: 1811
I have used the code here:
https://github.com/davici-code/AzureSignToolClickOnce
to succesfully sign ClickOnce applications in Azure DevOps with a certificate stored in Azure Key Vault.
It signs all the required executables and manifest files. Internally AzureSignTool is used to sign the executables and the mage code signs the manifest with Authenticode.
https://www.davici.nl/blog/clickonce-signing-from-azure-devops-via-azure-key-vault
For Jenkins it would also work.
Upvotes: 1