What a reset does
Each applet resets independently — wiping the FIDO function doesn't touch OATH, and so on. In every case the point is the same: keys and credentials are destroyed, not recoverable. Because the secrets only ever lived on the device, there is no backup to restore from unless you made one.
A whole-key reset is a sweep of independent steps, not a single atomic act. Each applet that completes comes back in factory condition, and every step reports its own outcome — so a run can legitimately end with some applets wiped, one failed, and the key still needing attention. Read the report; don't assume a clean slate because the command finished.
- FIDO2 — erases all resident credentials/passkeys, clears the PIN, and wipes the large-blob storage, including a name stored on the key. Any account relying solely on this key for sign-in is locked out until you register a replacement. FIDO2 →
- OATH — removes all stored TOTP/HOTP seeds and clears the applet
password. It needs no password to run, which makes it the only way back from a
forgotten one. On a Nitrokey 3 it also asks for a touch on the key. A CanoKey
resets it through its Admin applet, so there it asks for the CanoKey Admin PIN
(
oath reset --admin-pin); with that forgotten too, the whole-key reset below is the way back. You'll need each service's setup secret/QR again. OATH → - OpenPGP — destroys the on-card sign/encrypt/auth keys and resets PINs. Anything encrypted to the card's encryption key becomes undecryptable. OpenPGP →
- PIV — clears slots, certificates, PIN/PUK, and management key. PIV's reset is a vendor extension, so a whole-device reset first checks what keyroost knows about the card's PIV applet. Where reset is known to work, it sends RESET; if the card wants the PIN and PUK blocked first, keyroost blocks the PIN, tries again, and only then blocks the PUK. If the run stops in between, PIV stays locked and un-wiped until a reset finishes — the per-step report says which state it is in. A card with no entry gets a single RESET and nothing is blocked; a card listed as not supporting it is left out of the sweep, so it is never left locked with no way back. Some cards reset the whole device through their own command instead, and some need the management key or PIN for it — keyroost asks when they do. PIV →
- Token2 on-device OTP — erases every OTP entry stored on the key's own applet. The key asks for a confirming button press before it wipes. On an R3.4+ key this is also the only way back from a blocked OTP PIN — there is no PIN reset. On-device OTP →
- Feitian OTP — erases the accounts in a Feitian key's own OTP
applet, after a touch on the key; keyroost then checks that all three slots read
empty. On its own:
keyroostctl feitian reset. Feitian keys → - Token2 Molto2 — factory reset wipes loaded slots and restores the default customer key; the token asks you to confirm with its own button. Molto2 →
Before you reset — the checklist
- Have another way in. A second registered key, or current recovery codes, for every account this key unlocks. Verify it works before wiping.
- Re-derive what you'll re-add. Make sure you can re-enroll OATH seeds and regenerate or re-import OpenPGP/PIV keys.
- Decryption keys are special. Data encrypted to an OpenPGP encryption key or PIV key-management slot can't be read after the key is gone — decrypt or re-key it first.
- Then reset, set a fresh PIN, and re-register before relying on it.
A reset can't be reversed and the destroyed keys can't be regenerated from the device. When in doubt, stop and confirm your recovery path first.
How keyroost treats resets
A reset never guesses which key it is aimed at. With one key connected it uses
that key. With several, a terminal shows a numbered list to pick from; a script
is refused with the --device value for each key.
--reader or --path together with --device
is rejected, since they can name different keys. Before wiping, keyroost names
the key and asks y/N (factory-reset asks you to type
reset); a script must add --yes instead. Reset
support spans the FIDO2, OATH, OpenPGP,
PIV, Token2 on-device OTP, Feitian OTP, and Molto2 applets; read-only inspection
(list, fido info, piv info) never changes
anything and never needs a PIN.
Resetting a whole key at once
One command wipes every resettable applet the key exposes, in order — OATH, OpenPGP, Token2 on-device OTP, Feitian OTP, PIV, then FIDO2 last, because it ends with a ceremony:
keyroostctl factory-reset # asks you to type "reset"
keyroostctl factory-reset --device my-key --yes # in a script
The card applets need nothing from you, except that some keys ask for a touch: a
Nitrokey 3 to reset OATH, a BioPass FIDO Pro to reset PIV, and a Feitian key for its
OTP step; the Token2 OTP step waits for a confirming button press; keyroost says to touch the key during those steps, in the CLI and on the
app's Factory reset card. What the FIDO2 step asks for depends on the device's shape. A USB
key is asked to be unplugged and plugged back in within 60 seconds — keyroost
notices the replug on its own, no Enter needed — and then touched (touched and held,
on a key that asks for a long touch). keyroost records
the key's identity before the sweep starts and verifies the key that comes
back after the replug is the one you confirmed. A key that exposes no serial
can only be reset while it is the only device connected; otherwise the reset is
refused before anything is wiped, naming the devices to unplug. If no replug is
seen, nothing is sent and the step is reported as skipped. A card in a smart-card
reader has nothing to unplug and no touch surface, so it is reset in place:
keyroost resets the card in the reader (which opens the same brief
after-power-up window a replug does) and sends the wipe immediately. The same
in-place path is available on its own as
keyroostctl fido reset --reader <name> (not on a CanoKey's own
USB reader, where keyroost refuses and points to the reset over FIDO HID or
factory-reset). Each step prints its
own result, the command ends with a line like factory reset: 5 wiped, 0
skipped, 0 failed, and it exits nonzero if any step failed or was skipped.
The OTP applet on Feitian keys has a step of its own, which waits for a touch on the
key. Afterwards keyroost lists the applet's three slots: the step counts as wiped only
when every slot reads empty, and otherwise names the slot that still holds accounts or
couldn't be read. On its own it is keyroostctl feitian reset, or
Reset… in the app's Feitian OTP tab.
A CanoKey on its own USB reader takes a different path:
instead of the applet-by-applet sweep, keyroost runs CanoKey's own device-wide reset.
The firmware takes that reset only while the key's Admin PIN is blocked, so keyroost
first blocks it on purpose, with wrong PINs (unless it is blocked already); the
question you confirm says so. Then the key blinks five times. Each time, give it a
quick tap and let go within two seconds (holding it down doesn't count); the light
stops when a tap counts. There is no FIDO2 replug. Everything on the key goes back to
its defaults, every PIN included (the Admin PIN to 123456), and the
serial stays. This is also the way back from a forgotten Admin PIN. If the taps don't
register, nothing is erased, but the Admin PIN stays blocked until a reset goes
through, so run it again.
The desktop app offers the same sweep as a Factory reset card on a key's Overview tab, with a live per-step report — including a FIDO2 row — so you can see exactly which applets came back clean and which need another pass.
The Token2 Molto2 is not part of this sweep; it has its own
keyroostctl molto reset, which also needs a physical button
confirmation on the token. Molto2 →
Authoritative resources
From the command line: see Resetting on the Command line page.