kkeyroost

Learn · OpenPGP

OpenPGP card

An on-card PGP keypair for signing and encrypting email and files, signing git commits, and SSH — with the private key sealed inside the device.

keyroost screenshot — The OpenPGP card tab: card details, PINs, and on-card key generation or import.
The OpenPGP card tab: card details, PINs, and on-card key generation or import.

What it is

The OpenPGP Card (v3.4) is a smart-card application that holds up to three private keys and performs operations with them on-device:

Because the private keys never leave the card, a compromised laptop can ask the card to sign or decrypt while it's present, but can't walk away with the keys themselves.

Generate on-card vs. import

PINs

The card uses a user PIN (day-to-day) and an admin PIN (management), each with its own retry counter that locks the function after too many wrong tries. How key PINs work →

What keyroost does with OpenPGP

k

Read card status and a slot's public key, and verify a PIN without changing anything; generate keys on-card in any algorithm the card accepts — RSA 2048/3072/4096, Ed25519, X25519, NIST P-256/384/521, secp256k1, brainpool — the choice offered from the card's own algorithm list (keyroostctl openpgp algorithms), or import an RSA-2048 key by host keygen or from a PKCS#1/PKCS#8 PEM/DER file, for the sign, decrypt, or auth slot (--slot decrypt, --slot auth); sign (SHA-256 or SHA-1), decrypt, and authenticate (client/SSH signature with the Authentication key); set cardholder name / URL; register a key for GnuPG; change the user or admin PIN and unblock a locked PIN (via the admin PIN / PW3); and factory-reset the applet. The output of sign/authenticate is the card's raw signature: PKCS#1 for RSA, r||s (not DER) for ECDSA, R||S for Ed25519.

keyroostctl openpgp status --reader yubikey
keyroostctl openpgp generate-key --slot sign --algorithm ed25519 --yes --admin-pin-stdin --reader yubikey
keyroostctl openpgp sign --in msg.txt --pin-stdin --reader yubikey
keyroostctl openpgp authenticate --in chal.bin --pin-stdin --reader yubikey
keyroostctl openpgp change-pin --old-pin-stdin --new-pin-stdin --reader yubikey

The card byte layer is a pure-Rust, in-tree implementation of the OpenPGP Card spec (APDU + BER-TLV); RSA keygen/parsing is the one scoped host-side dependency. Host-side import of ECC keys and local signature verification are not offered; they would need new cryptographic dependencies, which this project adds only deliberately.

Authoritative resources