gnupg – I plugged in a yubikey containing pgp subkeys, now secret key stubs are present


  • Create keypair on a live distro, upload public key, move secret subkeys to Yubikey
  • Reboot into normal disto
  • Plug in yubikey, and then remove it
  • Run gpg --recv-keys HANDLE to receive public key
  • Run gpg --list-secret-keys.

The result is that the secret key stubs show up in the secret key list. Running gpg --delete-secret-keys HANDLE errors, because the keys are not present (only the stubs are present).

The secret key has 100% never been on this machine, so I’m not clear on why the stubs are here. Presumably they were automatically imported from the yubikey, but it seems odd that I can’t delete them. Is this expected behaviour?