Digital Signature
Definition
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.
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 with PKCS#1 v1.5 or PSS padding, ECDSA, Ed25519 and the post-quantum 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 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:
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.