Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Public Key

Direct answer

A public key is the shareable half of a key pair, published in certificates or authorized_keys. Others use it to encrypt data for the owner or verify the owner's signatures.

When to use this

Use this when sharing or verifying a public key.

First 30 seconds

1. Public keys can be shared freely.

2. Bind them to identities (certificates, fingerprints).

3. Verify fingerprints out of band.

4. Distribute via trusted channels.

5. Replace when private key is compromised.

Operational verification

private key → public key → shared and bound to identity

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Trusting a public key received over the same channel as the message (no out-of-band check).
  • Accepting changed SSH host keys without investigation.
  • Publishing keys without expiry or a revocation path.
  • Pinning keys in apps without a backup pin, causing outages on rotation.
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
Key commandopenssl x509 -in cert.pem -noout -pubkey | openssl sha256
Scope / prerequisiteUse this when sharing or verifying a public key.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checking a public key Verify boundary
openssl pkey -pubin -in pub.pem -text -noout
ssh-keygen -lf ~/.ssh/id_ed25519.pub          # fingerprint
openssl x509 -in cert.pem -noout -pubkey | openssl sha256

Compare fingerprints through a separate channel before trusting a key (SSH first connection, PGP).

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
  • Public keys can be shared freely.
  • Their authenticity must be verified.
  • Certificates bind keys to identities.
Key checks
  • openssl pkey -in key.pem -pubout -out pub.pem — extract public key
  • ssh-keygen -y -f — /.ssh/id_ed25519~SSH public key
  • openssl x509 -in cert.pem -noout -pubkey — from certificate
ReferenceWhy it matters1 section · depth on demand

Distributing public keys

Public keys are not secret, but you must trust that a public key belongs to the right owner:

  • Certificates signed by a CA (TLS, S/MIME, VPN).
  • SSH known_hosts and authorized_keys (trust on first use or SSH certificates).
  • Key fingerprints verified out of band.

openssl x509 -in cert.pem -pubkey -noout extracts a public key; ssh-keygen -lf key.pub shows its fingerprint.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

A public key is the shareable half of an asymmetric key pair. Others use it to verify your signatures or to encrypt data (or establish keys) that only your private key can use. Certificates distribute public keys bound to identities.

openssl pkey -in private.pem -pubout -out public.pem
ssh-keygen -y -f ~/.ssh/id_ed25519 > id_ed25519.pub
ssh-keygen -lf id_ed25519.pub          # fingerprint

Public keys are not secret, but their authenticity matters: an attacker who substitutes their own public key can impersonate the owner. Verify fingerprints out of band (SSH host keys) or rely on a trusted CA (TLS certificates).

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 → Public Key. 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?