I'm trying to understand better how GnuPG works. When I run:

gpg --edit-key chloe

I would expect to see something like this (from the GnuPG privacy handbook):

Secret key is available.

pub  1024D/26B6AAE1  created: 1999-06-15 expires: never      trust: -/u
sub  2048g/0CF8CB7A  created: 1999-06-15 expires: never
sub  1792G/08224617  created: 1999-06-15 expires: 2002-06-14
sub   960D/B1F423E7  created: 1999-06-15 expires: 2002-06-14
(1)  Chloe (Jester) <chloe@cyb.org>
(2)  Chloe (Plebian) <chloe@tel.net>

with the public key listed alongside any subkeys.

Instead what I see is:

Secret key is available.

sec  2048g/0CF8CB7A created: 1999-06-15 expires: never usage: SC trust: ultimate validity: ultimate
ssb  960D/B1F423E7 created: 1999-06-15 expires: never usage: E
[ultimate] (1). Chloe (Jester) <chloe@cyb.org>

Why is there a difference between my output and the example output?

Could somebody give an explanation of what my output means?


The example in the documentation seems outdated. GnuPG 1.4 lists the output you expected, and actually changes the display when running toggle. GnuPG 2.1 (maybe also 2.0, but I expect this to be specific to GnuPG 2.1 which merged private and public keyrings). immediately lists the private keys as such. While it still accepts the toggle command, it does not seem to perform any action (although I did not look up the implementation in the code). Also, it is not listed in the output of the help command.

The reason behind toggle in older versions of GnuPG is that it used two separate keyrings for public and private keys. toggle switched among which of the keyrings is edited. GnuPG 2.1 merged the private keys, thus the toggle command is not required any more.

  • Opening a bug report seems to be reasonable. I put this on my todo list and will open one after verifying the issue further and looking up whether there already is a matching issue, but will not get around to do so within the next days. If you open one, please drop a link to the report here (and consider referencing this Q&A in the bug report). – Jens Erat Jul 15 '17 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.