# What Is Code Signing Certificate? Definition and Examples

> Code signing certificates are X.509 certificates with the codeSigning extended key usage, used to sign software so users can verify its publisher and integrity.

Source: https://ssl.sh/glossary/code-signing-certificate/
Last updated: 2026-11-10

A code signing certificate binds a software publisher's identity to a key pair and carries the codeSigning [extended key usage](https://ssl.sh/glossary/extended-key-usage/) (OID 1.3.6.1.5.5.7.3.3). The publisher signs executables, installers, drivers, scripts or packages with the [private key](https://ssl.sh/glossary/private-key/); the operating system or runtime verifies the signature against trusted roots before running or installing the code. Publicly trusted code signing certificates for Windows Authenticode are issued under the CA/Browser Forum's Code Signing Baseline Requirements, a separate rulebook from the TLS Baseline Requirements, while macOS and iOS rely on certificates issued by Apple to registered developers.

## Why it matters
A valid signature tells users and security tools who published the file and that it has not been modified since signing; unsigned installers are more likely to trigger operating system warnings. Because stolen signing keys have been used to sign malware, current requirements oblige CAs to ensure that subscriber keys are generated and stored in hardware, such as a token, an [HSM](https://ssl.sh/glossary/hsm/) or a cloud signing service, rather than in an exportable file. Signing with a trusted timestamp (RFC 3161) lets the signature remain valid after the certificate expires.

## Example
```powershell
signtool sign /fd SHA256 /tr http://timestamp.example.com /td SHA256 /a setup.exe
signtool verify /pa /v setup.exe
```

## Common misconceptions
- **My TLS certificate can sign code.** TLS certificates lack the codeSigning EKU, and browser root programs now require TLS hierarchies to be dedicated to server authentication.
- **Signed software is safe.** A signature identifies the publisher and proves integrity; it says nothing about whether the code is benign.
- **Signatures break when the certificate expires.** Not if a timestamp was applied at signing time; untimestamped signatures do fail after expiry.

## Related terms

- [EKU](https://ssl.sh/zh/glossary/extended-key-usage/): EKU 即扩展密钥用途，是列出证书可用于哪些目的（如 serverAuth 服务器认证、clientAuth 客户端认证、代码签名）的 X.509 扩展。
- [HSM](https://ssl.sh/zh/glossary/hsm/): HSM 是一种防篡改的硬件设备，在内部生成、保存并使用密钥，私钥不会以明文形式离开设备。
- [数字签名](https://ssl.sh/zh/glossary/digital-signature/): 数字签名是用私钥对消息计算出的一个值，任何持有对应公钥的人都能验证它，从而确认消息来源和内容未被篡改。
- [X.509](https://ssl.sh/zh/glossary/x509/): X.509 是 ITU-T 制定的公钥证书标准格式，其互联网配置规范 RFC 5280 规定了 TLS 所用证书的结构和验证方法。
- [PKCS#7](https://ssl.sh/zh/glossary/pkcs7/): PKCS#7 是一种用于签名和加密数据的格式，在 .p7b 或 .p7c 文件中常用来打包一组证书，不含私钥。
- [证书颁发机构](https://ssl.sh/zh/glossary/certificate-authority/): 证书颁发机构（CA）是负责审核申请者、签发数字证书，并把公钥与域名或身份绑定在一起的机构。
- [私钥](https://ssl.sh/zh/glossary/private-key/): 私钥是非对称密钥对中保密的那一半，TLS 服务器用它证明自己拥有证书里的那把公钥。
