Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Digital Signatures

Direct answer

A digital signature is created with a private key over a hash of data, and anyone with the public key can verify that the data is unchanged and came from the key holder. It underpins certificates and code signing.

When to use this

Use this when proving data integrity and origin with digital signatures.

First 30 seconds

1. Digital signatures verify software, documents, containers, updates.

2. Verify before trusting.

3. Protect signing keys (HSM, keyless signing with transparency logs).

4. Timestamps for long-term validity.

5. Check revocation.

Operational verification

artifact → signature → verify with trusted key

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Verifying a signature but not who owns the key (no trust chain).
  • Signing a hash with a weak algorithm (SHA-1).
  • Code signing keys on build servers without HSM protection.
  • Not timestamping code signatures, so they become invalid when the certificate expires.
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when proving data integrity and origin with digital signatures.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Sign with the private key; verify with the public key.
  • The signature covers a hash of the data.
  • Trust depends on how the public key is obtained.
Key checks
  • gpg --verify file.sig file — verify signature
  • cosign verify --key cosign.pub <image> — container signature
  • Get-AuthenticodeSignature <file.exe> — Windows code signing
ReferenceWhy it matters1 section · depth on demand

Signing and verifying

openssl dgst -sha256 -sign private.key -out file.sig file
openssl dgst -sha256 -verify public.pem -signature file.sig file

Documented example, not captured output. Uses: code signing, package signatures (apt, rpm, container images with Cosign), certificates, DNSSEC, Git commit signing. Verification must also check that the public key is trusted for that purpose.

ReferenceHow it works1 section · depth on demand

In depth

Digital signatures in asymmetric cryptography use a private key to sign a hash of the data and the public key to verify it. Verification proves the data came from the key holder and was not modified.

AlgorithmNotes
RSA-PSS / RSA PKCS#1 v1.5Widely used; 2048+ bits
ECDSA (P-256, P-384)Smaller keys; requires good random nonces
Ed25519Fast, deterministic, simple to use correctly
ML-DSA, SLH-DSAPost-quantum signatures (NIST 2024)
ssh-keygen -Y sign -f ~/.ssh/id_ed25519 -n file release.tar.gz
ssh-keygen -Y verify -f allowed_signers -I admin@example.com -n file -s release.tar.gz.sig < release.tar.gz

A signature is only as trustworthy as the binding between public key and identity — provided by certificates, key servers or out-of-band verification.

ReferenceConfiguration & state1 section · depth on demand

Commands

openssl dgst -sha256 -sign priv.key -out file.sig file.txt
openssl dgst -sha256 -verify pub.pem -signature file.sig file.txt
ssh-keygen -Y sign -f ~/.ssh/id_ed25519 -n file file.txt

Documented example, not captured output. A signature shows the holder of the private key signed the exact bytes; it says nothing about whether that key is trusted — that is the PKI's job.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Asymmetric Cryptography → Digital Signatures. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://csrc.nist.gov/pubs/fips/186-5/final · confidence 94%
Confirmation

Confirm action

Continue?