GPG keys

Android · Linux · macOS · Windows
View Markdown

A GPG Key item holds an OpenPGP certificate and, optionally, its private key. This page lists what Keyguard reads from a key, what you can do with it, and how Keyguard uses keyservers.

Storage

  • On a Bitwarden server, a GPG key item is a secure note with custom fields. Custom field conventions lists them.
  • Keyguard stores an imported private key without its passphrase. It asks for the passphrase once, during import. From then on, the vault’s encryption protects the key.

Certificate versions

An OpenPGP certificate is a primary key with its subkeys, user IDs and metadata, bound by self-signatures. Keyguard supports two versions.

VersionStandardUser IDs
v4RFC 4880At least one active user ID
v6RFC 9580Optional. A Direct Key self-signature holds the key-wide policy.

Identifiers

IdentifierWhat it isFormat in Keyguard
FingerprintHash over the public key material and creation time; identifies the whole certificate40 hex digits for v4, 64 for v6; upper-case, grouped in fours
Key IDThe low 64 bits of a v4 fingerprint, or the high 64 bits of a v6 fingerprint16 upper-case hex digits
Keygriplibgcrypt’s hash of the raw public parameters; addresses a key inside the agentUpper-case hex, byte-identical to gpg --with-keygrip

Capabilities

Keyguard reads the OpenPGP key flags of the primary key and every subkey. An item shows what the certificate as a whole can do.

CapabilityMeaning
SignThe key can create signatures
Encrypt/decryptThe key can be an encryption recipient

Key details

DataWhat Keyguard reads
Primary key and subkeysFingerprint, keygrip, key ID, algorithm, bit strength, capabilities, revocation state and expiration date
User IDsThe Name (comment) <email> form. Keyguard shows the email addresses, and also reads bare-email user IDs.
DatesCreation and expiration, from the key’s self-signature
RevocationRevoked keys and subkeys are marked as revoked

Edits

These edits work with v4 and v6 certificates. They’re on the item’s edit screen. Open User IDs to manage identities. Change GPG key expiry is also in the item’s menu.

EditRule
Change GPG key expiryNeeds the private key
Add User IDNeeds the private key. Keeps the current primary identity.
Make primarySelects the identity displayed by default. You can change it later. Needs the private key.
Replace…Adds the replacement and revokes the selected identity. Needs the private key.
Revoke…Needs the private key. A v4 certificate must keep an active user ID; a v6 certificate can revoke its last one.

Select Name and email or Exact User ID to choose the input format. Revoked identities remain under Identity history. If a signature’s timestamp blocks an edit, Keyguard shows when to retry. Check your devices’ clocks, then select Retry after that time.

After an edit, save the item, then upload or redistribute its public key. Cancelling the item editor discards the changes.

Algorithms

Keyguard recognizes these public-key algorithms by their OpenPGP algorithm IDs.

AlgorithmNotes
RSASigning and encryption
DSALegacy signing
ElGamalLegacy encryption
ECDSANIST-curve signing
EdDSA, Ed25519Edwards-curve signing (legacy ID 22 and RFC 9580 native ID 27)
ECDHElliptic-curve encryption
X25519, X448RFC 9580 native encryption
Ed448RFC 9580 native signing

Keyguard shows any other algorithm generically.

Import

The add-item flow accepts ASCII-armored and binary keys. To create a new key instead, use the Generator.

InputResult
Public keyStored as a certificate
Private keyStored with its certificate. For a passphrase-protected key, Keyguard asks for the passphrase and reports a wrong one.
The certificate already in the itemMerged. Existing secret material, certifications and revocations stay.
A different certificate, or malformed dataRejected. The item doesn’t change.
More than one key in a fileRejected. Import the keys one at a time.
Empty input or an unsupported formatRejected, with a separate error for each

Export and copy

ActionResult
Export the public keyA .public.asc file
Export the private keyA .private.asc file
Export bothA .zip with both files
Copy public keyThe armored public key
Copy fingerprintThe fingerprint
Show the fingerprint QR codeAn OPENPGP4FPR: QR code that other OpenPGP apps can scan
Copy unencrypted private keyThe armored private key, without a passphrase

Tools

To encrypt, decrypt, sign or verify with these keys inside Keyguard, see GPG tools. To use them from GnuPG or Android apps, see GPG agent.

Keyservers

Keyguard can look up and publish public keys on a keyserver. Keyserver and Keyserver protocol in Settings > Developer > GPG agent choose the server.

ProtocolDefault or suggested serverSearch by
VKS (verifying keyserver, keys.openpgp.org API)https://keys.openpgp.orgFingerprint, long key ID or email
HKP (HTTP Keyserver Protocol)https://keyserver.ubuntu.comFingerprint, long key ID, email or free text

Lookups accept v4 and v6 fingerprints. VKS keyservers store v4 keys only. HKP keyservers return v6 keys through the HKP v2 API, which older keyservers lack. A refresh skips v6 keys that the keyserver cannot store.

keys.openpgp.org serves keys by fingerprint, and shares an email identity only after its owner confirms it. Keyguard queries VKS by fingerprint, long key ID or email. VKS has no free-text search, so Keyguard sends free-text queries to https://keyserver.ubuntu.com over HKP. Short key IDs are not supported because they are not unique. VKS rate-limits email lookups.

ActionWhereWhat it does
GPG keyserver searchSettings > Developer > GPG agentFinds a key on the keyserver, so you can import it. Also accepts an OPENPGP4FPR: URI or a scanned fingerprint QR code.
Upload GPG public keyItem menuPublishes a public key. On a VKS keyserver, you pick the email addresses that get a verification email; the key becomes searchable by each one after it’s confirmed.
Verify GPG public keyItem menuRecords whether a stored key is found and verified, found but unverified, not found, or revoked
Refresh GPG public keyItem menuUpdates the item’s public key, metadata and keyserver status from the keyserver
Auto-refresh public keysSettings > Developer > GPG agentAt the interval you set, updates each GPG key item that holds only a public key: its key, metadata and keyserver status. Runs while the app is active and the vault is unlocked.