Skip to content
atlas

Code signing

Also known as: software signing

Adding a digital signature to software so users and systems can check who made it and that nobody changed it afterwards.

Draft - this entry has not been reviewed yet.

Formal

The publisher computes a hash of a program, update, script or container image and signs it with a private key tied to a digital certificate; before installing or running it, the system checks the signature and certificate and refuses the file on any mismatch.

In plain English

Like the seal on a medicine bottle printed with the maker's name - if the seal is broken or the name is wrong, you do not swallow what is inside.

In practice

A municipality's IT operations team lets staff computers run only software signed by approved publishers; when a fake “update” arrives by email, Windows refuses to start it because the signature is missing.

Why it matters

Attackers often hide malware in updates that look genuine; a signature check stops any file changed after signing, though it cannot help if the signing key itself is stolen.

Technical deep dive

Every code-signing scheme applies a digital signature over a digest of the artefact, but formats differ by platform. Microsoft Authenticode (introduced 1996) embeds a PKCS#7/CMS SignedData structure in the PE file's certificate table, hashing the file while excluding the checksum and the signature area itself; Apple's codesign stores a code directory of per-page hashes and requires notarisation for Gatekeeper; Java signs JAR manifests; Linux distributions sign repository metadata or packages with OpenPGP keys; Android uses the APK Signature Scheme v2 and later, which covers the whole archive. The signer's X.509 certificate must carry the codeSigning extended key usage (OID 1.3.6.1.5.5.7.3.3) and chain to a root in the verifier's trust store.

Timestamping solves the expiry problem. A signature is sent to a Time-Stamping Authority per RFC 3161, which countersigns the signature's hash with a trusted time; verifiers then accept the signature after the certificate expires, as long as it was valid at the timestamp. It also shapes revocation: when a key is compromised, the CA can revoke with an invalidity date so that only signatures timestamped after the compromise fail. Publicly trusted code-signing certificates are governed by the CA/Browser Forum's Code Signing Baseline Requirements, which since 1 June 2023 require the subscriber's private key to be generated and kept in a hardware crypto module (HSM, token or cloud HSM service) and since 1 March 2026 limit certificate validity to 460 days.

Sigstore, an OpenSSF project, provides "keyless" signing aimed at open-source and container supply chains: cosign obtains an OIDC token for the signer's identity (a person's email or a CI workflow identity), Fulcio issues a certificate for an ephemeral key valid for about ten minutes, the signature and certificate are recorded in the Rekor transparency log, and verifiers check both the expected identity and issuer and the log inclusion. Notary Project's notation offers a PKI-based alternative for OCI artefacts; npm, PyPI and Maven Central have adopted Sigstore-based provenance or signatures in various forms.

The key limitation is that a signature attests to who signed, not to what the code does. Stolen keys have signed malware (Stuxnet used certificates stolen from Realtek and JMicron), and compromised build systems produce perfectly valid signatures on malicious code, as with SolarWinds Orion in 2020 and the 3CX desktop client in 2023. Effective programmes therefore protect keys in HSMs with separate approval for each signing operation, sign only in hardened release pipelines rather than on developer machines, pair signatures with build provenance (SLSA) and SBOMs, and enforce verification at the consumer: Windows Defender Application Control or AppLocker policies, macOS Gatekeeper, package-manager signature checks and Kubernetes admission controllers that reject unsigned images.

What to learn first

Everything this builds on, foundations first.

  1. Cryptographic key
  2. →Hashing
  3. →Digital identity
  4. →Public-key cryptography
  5. →Digital signature
  6. →Digital certificate
  7. →Code signing

Relationships

Sources & further reading

Official documentation

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Check yourself

Loading…

Atlas is in beta.