Skip to main content

    Code Signing in CI/CD: How to Automate Signing Without Exposing Your Key

    Automate code signing in CI/CD without exposing your key: USB tokens on self-hosted runners, SimplySign cloud sessions, or a pipeline-native service.

    MS
    My-SSL
    ·
    13 min read
    ·
    Published July 7, 2026
    ·
    Last updated November 10, 2026

    In short

    A CI/CD pipeline cannot hold a code signing key: since June 1, 2023, every publicly trusted key must be generated and used inside certified hardware, so there is no key file to store as a secret. The pipeline instead reaches that hardware in one of three ways: a USB token on a self-hosted runner, a CA's cloud signing session on an agent where a person has logged in, or a signing service such as Microsoft's Artifact Signing that authenticates with a service identity. In every setup, treat a missing timestamp as a failed build, because SignTool reports a failed timestamp only as a warning (exit code 2).

    A scoping note: everything below assumes you already have a certificate. If you are still choosing one, the Certum code signing certificates My-SSL sells (from $99/year) are delivered through SimplySign cloud signing, which is setup 2 in this guide, including its human login step.

    Three ways a CI/CD pipeline reaches a code signing key it is not allowed to holdThree stacked cards. USB token on a self-hosted runner: key on the token, PIN under your control, signs on one machine. Certum SimplySign: key in Certum's HSM, login code from the phone app, signs where someone logged in. Artifact Signing: key in Microsoft's HSM, an Azure identity signs in, Windows runners for the GitHub action. A gold band: fail the build if the timestamp is missing.Three ways a pipelinereaches a key it can't holdUSB token, self-hosted runnerKeyon the token, in your rackHumanPIN under your controlSignsone plugged-in machineCertum SimplySign (CA cloud)Keyin Certum's HSMHumancode from the phone appSignswhere someone logged inArtifact Signing (service)Keyin Microsoft's HSMHumannone: Azure identitySignsWindows GitHub runnersAll three: fail the buildif the timestamp is missing
    The setups differ in where the hardware sits and who has to open it; none of them makes a missing timestamp fail on its own, so that check is yours to add.

    Signing one installer by hand is a solved problem. The trouble starts when the signing has to happen on a build agent with nobody at a keyboard, because what makes code signing trustworthy is that the key isn't lying around where a script can grab it. This guide lays out the three arrangements that work, the human step each one still needs, and the verify step that stops a signed but untimestamped file from reaching your users. The verify commands were run on November 10, 2026; the SignTool, SimplySign and Artifact Signing behaviour comes from Microsoft's and Certum's documentation.

    Why you can't put the key in a CI secret

    A CI secret cannot hold a publicly trusted code signing key because the CA/Browser Forum's code signing requirements (§6.2.7.4.1 and §6.2.7.4.2) have, since June 1, 2023, required the key to be generated, stored and used in a hardware crypto module rated at least FIPS 140-2 Level 2 or Common Criteria EAL 4+. No .pfx file exists to paste in, so every CI/CD setup answers one question: how does an unattended pipeline reach hardware it may not contain?

    Why a CI secret can no longer hold a code signing keyTwo stacked panels. The upper panel, before June 2023 and drawn in grey with a dashed border, shows a .pfx key file stored in a pipeline's secrets store, where any job with the secret could copy the key. The lower panel, highlighted in gold, shows the rule since June 1, 2023: the key is generated inside certified hardware and never leaves it; the pipeline sends a file digest and gets a signature back.Before June 2023.pfx key file in theCI secrets storeany job with the secret copies itSince June 1, 2023key generated inside certifiedhardware, never leaves itpipeline sends a digest,gets a signature back
    Every compliant CI/CD signing setup is a version of the gold panel; the setups below differ only in where the hardware sits and who opens it.

    Before 2023, the usual advice was to base64-encode the .pfx into a pipeline variable, which put a copyable key on every runner that ever decrypted it. The requirements now accept three shapes of hardware (§6.2.7.4.1): a hardware module the subscriber runs, a cloud HSM where the key is created and kept and every access is logged, or a signing service that holds the key for you. Our code signing certificates explainer covers the rule itself. For pipeline design the consequence is simpler: the private-key operation always happens on that hardware, and the pipeline only delivers a file digest and collects a signature.

    The three CI/CD signing setups at a glance

    The three CI/CD signing setups are a USB token plugged into a self-hosted runner, a CA cloud signing session (Certum's SimplySign, for certificates bought through My-SSL) open on a build agent, and a pipeline-native signing service such as Azure Artifact Signing. They differ in where the key lives, which human step remains, and which runners can do the signing.

     Token + self-hosted runnerCA cloud signing (SimplySign)Signing service (Artifact Signing)
    Where the key livesOn the token, in your rackIn Certum's HSMIn Microsoft's HSM
    Human stepPIN entry; the PIN must stay under your controlLogin with a one-time token from the SimplySign phone appNone at signing time; an Azure identity authenticates
    Hosted runnersNo, needs the physical machineNo unattended login documented by CertumYes, Windows runners (GitHub action)
    CertificateYours, OV or EVYours, Standard or EVShort-lived (72 hours), no EV
    Who can use itAny validated publisherAny validated publisherOrganizations in 12 listed regions; individuals in the US or Canada
    Typical failureToken unplugged or lostNobody has logged in, signing step failsPublisher outside the eligible countries

    The next three sections take the setups one at a time, including the failure each one tends to show only at release time.

    Setup 1: a USB token on a self-hosted runner

    A USB token signs only on a machine that can physically see it, which rules out GitHub-hosted and other cloud-hosted runners: those are fresh virtual machines with no USB device of yours attached. Teams that sign with a token register a self-hosted runner on the machine where the token stays plugged in and send the signing job to it with runner labels.

    The awkward part is the PIN. An unattended job has nobody to type it, so the PIN ends up in a configuration file or an environment variable on that runner. The code signing requirements (§9.6.3) oblige the subscriber to keep the key's activation data, the password or token PIN, under sole control and properly protected, so a PIN sitting on a build machine is a compliance question as well as a security one. Keep that machine out of the general runner pool.

    The other issue is concentration: one machine, one small object, and one key that cannot be copied off the token, so it is gone if the token is lost or damaged. For a team that signs a few releases a year from its own server room, this is workable. It gets harder as the release cadence grows.

    Setup 2: cloud signing through a logged-in session

    With CA cloud signing the key sits in the CA's HSM, and CI becomes a question of who logs in. Certum's SimplySign Desktop connects to the cloud certificate with a username and a one-time token generated in the SimplySign phone app. Certum's signing manual documents signing many files in one session, but no unattended or headless login and no session length, so the pipeline signs on an agent where a person has connected.

    On that agent, SimplySign Desktop presents the certificate as a virtual smart card. SignTool selects it by thumbprint or subject name and signs as it would with local hardware, so the commands from our SignTool walkthrough run unchanged, timestamped against http://time.certum.pl. Certum's manual covers the same flow for jarsigner; for Electron builds, see our guide to signing an Electron app. SimplySign Desktop is published for Windows 10 and 11, macOS, and Linux distributions with a Cinnamon, MATE or KDE Plasma desktop. This is the setup you get with the Certum certificates My-SSL sells, Standard or EV.

    Two limits to plan around. First, the login is a person's job, so a release can wait until someone with the paired phone connects the agent. Make the signing job check that the virtual card is present and fail with a clear message if it isn't, instead of letting SignTool report a missing certificate. Second, volume: as of November 2026, Certum allows 5,000 signatures a month on its cloud code signing certificates and may contact you or block the product for the rest of the month if you exceed that. Signing releases fits easily; signing every nightly artifact may not.

    Setup 3: pipeline-native signing services

    A pipeline-native signing service keeps the key in the provider's HSM and lets the pipeline authenticate with a machine identity instead of a person, so it runs on ordinary hosted runners. Microsoft's Artifact Signing, which Microsoft announced as the new name for Trusted Signing on January 12, 2026, is the main example, with a GitHub action and an Azure DevOps task.

    The model differs from the first two setups: you don't bring a certificate; you create a signing account, Microsoft validates your identity, and the service signs with certificates that are valid for 72 hours and renewed daily. Microsoft recommends OpenID Connect for the GitHub action, and the action runs only on Windows runners (Microsoft names windows-2025 and windows-2022; Arm runners are not supported).

    Two conditions decide whether it fits. Eligibility: as of November 2026, Microsoft's quickstart lists Public Trust certificates for organizations in the United States, Canada, the European Union, the United Kingdom, Australia, New Zealand, Japan, South Korea, Singapore, Switzerland, Norway and Israel, and for individual developers in the United States or Canada only. Certificate type: Microsoft's FAQ says the service issues no EV certificates and has no plan to. That matters if you ship drivers, because the Windows Hardware Developer Program requires an EV code signing certificate. Publishers outside those regions, or who need EV, are back to the first two setups. For how SmartScreen reputation builds under any of them, see our separate guide.

    Pipeline rules that keep automated signing safe

    Whichever setup you pick, four pipeline rules keep automated signing safe: sign once, at the end, only for release builds; timestamp every signature and fail the job when the timestamp fails; verify the result in a separate step; and gate the signing job as strictly as a production deploy.

    Where signing belongs in a release pipelineA top-to-bottom flow: build and test run on every commit; a release gate where a person approves; the signing and timestamping step, highlighted in gold, where a SignTool exit code of 2 is treated as a failure; a verify gate that stops any file without a timestamp; then ship.Buildevery commitTestevery commitRelease gatea person approvesSign + timestampexit code 2 counts as failureVerify gateno timestamp, no releaseShip
    Nothing above the release gate can produce a signature, and nothing without a timestamp gets past the verify gate.

    Signing late and rarely makes the rest manageable. A pipeline that signs every commit turns "who can open a pull request" into "who can get a file signed in your name", and spends quota on builds nobody ships. Timestamping matters because a timestamped signature stays valid after the certificate expires; Microsoft states that without a timestamp the signature becomes invalid when the signing certificate expires, and Windows then treats the file as unsigned.

    Access control is the rule about people: restrict the signing job to protected branches, put an approval in front of it, and keep the signing machine or the service credential away from ordinary CI jobs. The hardware rule took key theft mostly off the table; what is left to defend is the ability to ask your own hardware to sign the wrong file.

    How do you fail a build when the timestamp is missing?

    To fail a build when the timestamp is missing, check for it explicitly, because neither common tool does so by default. On Windows, run signtool verify /pa /tw and treat exit code 2 as a failure: Microsoft documents exit code 0 as success, 1 as failure and 2 as completed with warnings, and /tw raises a warning when the signature isn't timestamped.

    The same exit code 2 appears at signing time. Microsoft's SignTool reference says that if time stamping fails, the command generates a warning, so a job that only stops on exit code 1 can carry on with a file that is signed but not timestamped. On a Linux runner, osslsigncode needs its own check. We signed PuTTY 0.85 (its original signature removed) with a lab certificate on November 10, 2026, using osslsigncode 2.8 with OpenSSL 3.0.13 on Ubuntu 24.04. Signed without a timestamp, the file still verifies with exit code 0:

    $ osslsigncode verify -CAfile lab.crt -in nots.exe ... Timestamp is not available ... Signature verification: ok Number of verified signatures: 1 Succeeded $ echo $? 0

    Pointed at a timestamp server it could not reach (a closed local port, then an unresolvable host), osslsigncode 2.8 crashed with a segmentation fault, exit status 139, and wrote no output file. That stopped the job in our run, but a crash is not behaviour to rely on, so the verify gate below does the real check. Signed against http://time.certum.pl, the verify output carried a Timestamp time: line and a chain to Certum Timestamping 2021 CA. That line is what a gate can test for:

    #!/bin/sh # fail the release if the file is unsigned, invalid, or not timestamped out=$(osslsigncode verify -CAfile "$2" -in "$1" 2>&1) || { echo "$out"; exit 1; } echo "$out" | grep -q "Timestamp time:" || { echo "no timestamp: $1"; exit 1; } echo "ok: $1"

    In our run the gate returned 1 for the untimestamped file ("no timestamp: nots.exe"), 1 for the unsigned file and 0 for the file timestamped by Certum. In a real pipeline, pass the CA bundle your users' systems trust instead of a lab certificate. Java and NuGet have their own verify commands, jarsigner -verify and dotnet nuget verify (see signing NuGet packages); run them as their own stage for the same reason. We did not run SignTool in this test; its behaviour above is from Microsoft's documentation.

    Frequently Asked Questions

    Quick answers to related questions.

    Can I export my code signing certificate to a .pfx for CI/CD?

    No. Since June 1, 2023, the CA/Browser Forum's code signing requirements have required every publicly trusted code signing key to be generated, stored and used in a hardware crypto module certified to at least FIPS 140-2 Level 2 or Common Criteria EAL 4+. The key cannot leave that hardware, so the .pfx file you would paste into a secrets store does not exist. Tutorials that base64-encode a .pfx into a pipeline variable describe certificates issued before that date.

    Does cloud code signing work on GitHub-hosted runners?

    It depends on how the service authenticates. Certum's SimplySign Desktop connects with a username and a one-time token from the SimplySign phone app, and Certum's manual documents no unattended or headless login, so a fresh hosted runner has no open session to sign with; route that job to a machine where a person has connected. Microsoft's Artifact Signing authenticates with an Azure identity instead (Microsoft recommends OpenID Connect), and its GitHub action runs on Windows hosted runners only.

    Should my pipeline sign every build?

    No. Sign release candidates, not every commit. Signing each CI build uses up quota (as of November 2026, Certum allows 5,000 signatures a month on its cloud code signing certificates and may block the product for the rest of the month when the limit is exceeded), fills the audit trail with binaries nobody ships, and gives anyone who can open a pull request a path to a signed file. A release pipeline that someone triggers on purpose, behind an approval, is the safer shape.

    Do I need an EV certificate to sign in CI/CD?

    No. OV and EV code signing certificates sign through the same tools and fall under the same hardware rule, so a pipeline works the same way with either. Pick the tier for other reasons: EV is issued only to registered organizations, Microsoft requires an EV certificate to register for the Windows Hardware Developer Program, and Microsoft states that EV certificates no longer bypass or affect SmartScreen.

    What if the timestamp server is unreachable during a build?

    Fail the build and retry. Microsoft documents that when time stamping fails, SignTool generates a warning, which means exit code 2, not 1, so a pipeline that only checks for exit code 1 can ship a file that is signed but not timestamped. Without a timestamp the signature becomes invalid when the certificate expires. In our test on November 10, 2026, osslsigncode 2.8 crashed (exit status 139) and wrote no output file when the timestamp server could not be reached, so check the timestamp in a verify step whatever the signing tool reports.

    Can a Linux build agent sign with a Certum cloud certificate?

    Certum publishes SimplySign Desktop for Linux (Debian, Ubuntu, Mint, CentOS and Fedora with a Cinnamon, MATE or KDE Plasma desktop) as well as for Windows and macOS, and states that its cloud code signing supports signing tools on Linux, Unix and macOS. The desktop requirement matters for CI: Certum lists a graphical desktop environment, not a server-only install, so plan for an agent a person can log in to.

    Still Have Questions?

    Contact our support team with questions about certificates, installation, or technical issues.

    The bottom line

    CI/CD signing stopped being a secrets problem in 2023 and became an architecture choice: a token on a self-hosted runner if you sign rarely and on-premises, a signing service if you are in its regions and don't need EV, and a CA cloud session on a dedicated agent if you want a certificate in your own name without hardware to manage. If that last option is yours, the Certum code signing certificates at My-SSL sign through SimplySign once validation clears, at $99/year for Standard and $299/year for EV, with no token to ship to your build room.

    Updated November 10, 2026: corrected how SignTool handles a failed timestamp (a warning, exit code 2), updated Artifact Signing eligibility, runners and certificate terms, replaced the SimplySign section with what Certum documents about login, added a tested verify gate with osslsigncode 2.8 output, and removed claims we could not source.