# What Is Digital Signature? Definition and Examples

> A digital signature is a value computed over a message with a private key that anyone holding the matching public key can verify, proving origin and integrity.

Source: https://ssl.sh/glossary/digital-signature/
Last updated: 2026-11-10

A digital signature scheme has three operations: key generation, signing (private key plus message gives a signature) and verification (public key, message and signature give valid or invalid). The message is normally hashed first and the digest is signed. A valid signature shows that the holder of the private key produced it and that the message has not changed since. Common schemes are [RSA](https://ssl.sh/glossary/rsa/) with PKCS#1 v1.5 or PSS padding, [ECDSA](https://ssl.sh/glossary/ecdsa/), Ed25519 and the post-quantum [ML-DSA](https://ssl.sh/glossary/ml-dsa/).

## Why it matters
TLS depends on signatures in two places. Every certificate carries its issuer's signature over the certificate contents, and clients verify each link of the [certificate chain](https://ssl.sh/glossary/certificate-chain/) up to a trusted root. During the handshake the server signs the handshake transcript (CertificateVerify in TLS 1.3, ServerKeyExchange in TLS 1.2 with ECDHE), proving it holds the private key for the certificate. CT log SCTs, OCSP responses and CRLs are signed too.

## Example
See which algorithm signed a certificate, and sign and verify a file yourself:

```bash
openssl x509 -in example.com.crt -noout -text | grep 'Signature Algorithm'
openssl dgst -sha256 -sign example.com.key -out file.sig file.txt
openssl dgst -sha256 -verify example.com.pub -signature file.sig file.txt
```

The last command prints `Verified OK` when the signature matches.

## Common misconceptions
- **"Signing is encrypting with the private key."** That is a loose analogy for textbook RSA only. ECDSA, Ed25519 and ML-DSA do not encrypt anything, and real RSA signatures use dedicated padding.
- **"A valid signature means the content is trustworthy."** It proves who signed and that nothing changed; whether to trust the signer is a separate decision.
- **"A certificate's Signature Algorithm shows the site's key type."** It shows the issuer's algorithm. The site's key type is in the Subject Public Key Info, so an ECDSA key can sit in a certificate signed with sha256WithRSAEncryption.

## Related terms

- [公钥](https://ssl.sh/zh/glossary/public-key/): 公钥是非对称密钥对中可以公开的一半，写在证书里，供他人验证由对应私钥生成的签名。
- [私钥](https://ssl.sh/zh/glossary/private-key/): 私钥是非对称密钥对中保密的那一半，TLS 服务器用它证明自己拥有证书里的那把公钥。
- [RSA](https://ssl.sh/zh/glossary/rsa/): RSA 是 1977 年提出的公钥算法，TLS 用它对证书和握手进行签名，在 TLS 1.3 之前还用它传输会话密钥。
- [ECDSA](https://ssl.sh/zh/glossary/ecdsa/): ECDSA 是基于椭圆曲线的数字签名算法，在 TLS 证书中作为 RSA 的替代方案，密钥和签名更小、签名运算更快。
- [哈希函数](https://ssl.sh/zh/glossary/hash-function/): 哈希函数（密码学哈希函数）把任意长度的输入映射为固定长度的摘要，且在计算上无法逆推输入，也无法找到摘要相同的两个输入。
- [证书链](https://ssl.sh/zh/glossary/certificate-chain/): 证书链是从网站终端证书经中间证书一直到受信任根证书的有序证书序列，每一张都由下一张签名。
- [ML-DSA](https://ssl.sh/zh/glossary/ml-dsa/): ML-DSA 是 NIST 于 2024 年 8 月在 FIPS 204 中标准化的基于格的后量子数字签名算法，源自 CRYSTALS-Dilithium。
