Code signing is a method for attaching a digital signature to software so a computer can identify the signer and detect changes made after signing. It is used with applications, drivers, scripts, packages, firmware, and updates. The publisher does not usually sign every byte directly. A signing tool first calculates a cryptographic hash, a fixed-length digest that depends on the file’s contents. The publisher then uses a private signing key to create a signature over that digest and stores the signature, certificate information, and related data in or beside the software package.
Verification repeats the essential calculation. The operating system or package manager hashes the software it received, uses the public key associated with the signer to verify the signature, and checks whether the verified digest matches the new digest. A mismatch means the file changed or the signature data is invalid. A match shows that the signed content has remained consistent since the holder of the private key approved it. Public-key cryptography makes this possible because the public key can verify a signature without revealing the private key needed to create a new one.
A digital certificate connects the public key to an identified publisher. Certificate authorities issue certificates after applying their validation rules, and software platforms maintain trust stores containing selected root authorities. Verification can follow a certificate chain from the publisher’s certificate through intermediate certificates to a trusted root. The verifier may also check purpose, expiration, revocation, and policy requirements. This is why two devices can treat the same signature differently: their trust stores, network access, platform rules, or clock settings may differ. A valid mathematical signature alone does not guarantee that the certificate is trusted.
Trusted timestamps address a common timing problem. Certificates expire, but users may need to install software that was legitimately signed while a certificate was valid. A timestamp service signs evidence that the code signature existed at a particular time. A platform can then evaluate the publisher’s certificate at that signing time, subject to its policy and any later revocation. Without an accepted timestamp, an otherwise valid package may stop being treated as signed after the certificate expires. Timestamping does not preserve trust if the key was compromised or the certificate was revoked under rules that invalidate earlier signatures.
Code signing provides integrity and publisher identity, not a promise that software is safe, bug-free, or well designed. A trusted company can accidentally sign vulnerable code. Attackers can also steal a signing key, compromise a build system, or persuade a publisher to sign a malicious release. Protecting the private key is therefore central. Mature teams restrict access, use hardware security modules or protected signing services, separate signing from ordinary developer machines, log approvals, scan release artifacts, and design a rapid revocation and incident-response process. Reproducible builds and signed manifests can provide additional checks.
Users often see several distinct outcomes. Unsigned software has no acceptable signature to evaluate. Invalidly signed software has a signature that does not match, is malformed, or fails a policy check. A valid but untrusted signature may identify a certificate that the device does not recognize. Platforms decide whether to block, warn, or allow each case, with stricter rules common for kernel drivers and automatic updates. Code signing works best as one control in a secured release pipeline. It helps answer who approved this artifact and whether it changed, while other defenses must answer whether the software should have been approved in the first place. Release teams should preserve signing records that connect a reviewed source revision, build output, signer, certificate, and timestamp. Those records make later investigation practical: responders can identify which products used a compromised key, compare artifacts with the approved release, and communicate precisely about what must be replaced or revoked.
No. Signing proves integrity and helps identify the signer. Encryption hides content from unauthorized readers; software may be signed without being encrypted.
Yes. A legitimate signer can make a mistake, or an attacker can compromise a key or build system. A signature is not a safety certification.
A trusted timestamp can show that software was signed while its certificate was valid, allowing later verification under the platform’s policy.
Explore more "Explainers"
Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.
