How to Read a PGP Key: Fingerprint, User ID and Expiry

A key card with a magnifier, fingerprint, user badge and calendar, illustrating how to read a PGP key

You can read a PGP public key by pasting the ASCII-armored block into a key reader and checking the fingerprint, user ID, algorithm, creation and expiry dates, and subkeys. That inspection is safe because a public key is meant to be shared. This guide explains what each field means, why a fingerprint is safer than a short key ID, and how to inspect a key in the browser before you encrypt to it.

What information is safe to read on a PGP key?

A public key is safe to open, inspect, and share. It is the block that starts with -----BEGIN PGP PUBLIC KEY BLOCK-----. Reading it does not give anyone the power to decrypt your mail or to sign as you. Tools that only parse a public key, such as the PGP key viewer, are designed for this job: they show identity and metadata so you can decide whether to use the key.

A private key is not for casual reading and not for sharing. It starts with -----BEGIN PGP PRIVATE KEY BLOCK-----. Do not paste a private key into a key viewer, a chat, or a website that only needs to display a fingerprint. If you need to confirm you have the right secret key, do it on a machine you trust, and prefer your own keyring or a local tool. The decrypt flow that actually uses a private key is described in Why You Need Your Private Key to Decrypt a PGP Message.

When someone sends you a key, they should send the public block only. If a file contains both, or if the header says PRIVATE, stop and treat it as a secret. Public key inspection is the topic of this article.

What is a PGP fingerprint and how is it different from a key ID?

The fingerprint is a hash of the public key material, usually shown as 40 hexadecimal characters for a v4 key (sometimes grouped in five-character clusters). It is the value you should compare with the owner, on a call or another channel you already trust, before you encrypt sensitive data to that key or trust a signature from it.

A key ID is a shorter suffix of that identity, often 8 or 16 hex characters. Clients print key IDs because they are easier to glance at, and encrypted messages may list them as a hint for which secret key to try. Short 8-character IDs are not unique enough. Different keys can share a short ID, which has been used in confusion and collision attacks historically. Do not accept a key because the last eight characters look familiar.

When two people verify a key, they should read the full fingerprint, not a truncated ID. Our longer walkthrough is How to Share Your Public Key and Verify Fingerprints. You can also turn a fingerprint into a QR code with the PGP QR code generator if that makes an in-person check easier.

If a fingerprint does not match what the owner read to you, do not use the key, even if the user ID shows the right name and email address. User IDs are labels; the fingerprint is the identifier that binds to the key material.

What is a user ID on a PGP key?

A user ID (often written User ID or UID) is a label attached to the key, typically a name and email address such as Alex Rivera <alex@example.com>. A key can have more than one user ID. Nothing in OpenPGP stops someone from putting any name or email they want on a key they generated, so a familiar user ID is not proof of identity.

Treat the user ID as a filing label. It helps you search a keyring and tell two of your own keys apart. Trust comes from fingerprint verification, from signatures by keys you already trust (the web of trust, if you use it), or from a directory you have a separate reason to believe.

If you are generating a new pair, put an email address you actually use and will still use, because people will encrypt to that identity. You can add or revoke user IDs later in desktop GnuPG, but people who already saved the old key may not pick up the change automatically. For generation advice, see How to Generate a PGP Key Safely.

What does a key expiry date mean?

Many OpenPGP keys have a creation date and, optionally, an expiration date. After a key expires, well-behaved software will refuse to encrypt new messages to it, and may warn when verifying signatures made after the expiry. Messages already encrypted to that key can often still be decrypted with the private key; expiry is a policy on future use, not a shredder for old ciphertext.

Expiry is useful because it forces a check-in: you extend the date if the key is still in use, or you let it lapse if you have moved on. It is not a substitute for revocation. If a private key is lost or leaked before the expiry date, you should issue a revocation certificate so others stop using the public key immediately, rather than waiting for the clock.

A key with no expiration is valid until it is revoked or people stop using it. That is convenient, and it is also easy to forget in a backup. Whether you set an expiry is a trade-off; many guides suggest a period such as one or two years and a reminder to extend it. The key viewer shows creation and expiration dates when they are present in the packet.

If a key looks expired and you still need to talk to that person, contact them out of band and ask for a renewed or new public key, then verify the new fingerprint. Do not disable expiry checks just to force a message through unless you understand the risk.

What are subkeys?

A modern OpenPGP key is often a primary key plus one or more subkeys. The primary key usually certifies identity (it signs user IDs and other keys). A separate subkey is often used for encryption, and another may be used for day-to-day signing. From the outside, people still share one public key block that contains all of these parts.

When you inspect a key, you may see several fingerprints or key IDs, plus algorithms such as RSA, ECDSA, EdDSA, or ECDH, and flags that say what each part is for. The fingerprint you generally verify with the owner is the primary key fingerprint, unless they have told you to check a specific subkey.

Subkeys matter when decryption fails even though "you have the key." If you exported only a signing subkey, or imported a partial backup, the encryption subkey may be missing. Export the complete public or private bundle from your keyring, then inspect it again. Terminology for implementations is covered in PGP vs GPG vs OpenPGP.

How do I inspect a key in the browser?

1. Copy the public key block, including -----BEGIN PGP PUBLIC KEY BLOCK----- and the matching END line, or save it as a .asc file.

2. Open the PGP key reader and viewer. Paste the block or import the file. The tool runs locally in your browser; the key is not uploaded to the server.

3. Read the fingerprint, user IDs, algorithm, creation and expiry dates, and subkeys. Compare the fingerprint with the value the owner gave you on a trusted channel.

4. Only then encrypt to that key, for example on the PGP encryption tool page, or accept signatures from it. If the armor is damaged, restore the BEGIN and END lines and try again. If you need a refresher on message blocks, see What a PGP Message Looks Like.

If you are learning OpenPGP in general, the overview in What Is PGP and How Does It Work? puts these fields in context. If something about the key looks off (expired, unexpected user ID, or a fingerprint that does not match), do not ignore it. Pick another channel or wait for a key you can verify.

Frequently Asked Questions

Is it safe to paste a PGP public key into a key reader?

Yes. A public key is meant to be shared and inspected. Do not paste a private key into a viewer or into any form that only needs a fingerprint. Use a private key only in a decrypt or sign tool on a machine you trust.

What is the difference between a fingerprint and a key ID?

The fingerprint is the long hash you should verify with the key owner. A key ID is a shorter suffix used as a label. Short key IDs can collide, so they are not a safe way to identify a key on their own.

Can I trust a PGP key because the user ID has the right name?

No. Anyone can type a name or email address onto a key they create. Confirm the full fingerprint with the person you intend to reach, using a channel you already trust.

What happens when a PGP key expires?

Software will usually refuse to encrypt new messages to an expired key and may warn about signatures. You can often still decrypt old messages with the private key. For a lost or leaked key, create a revocation certificate instead of waiting for the expiry date.

Inspect a public key now

Paste a public key into the key viewer to read its fingerprint, user ID, expiry, and subkeys, then encrypt only if the fingerprint matches.

Open the key viewer Verify a fingerprint