`gpg --edit-key <user>` not listing public key

2

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?

John Godlee

Posted 2017-07-15T08:20:24.407

Reputation: 120

Answers

2

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.

Jens Erat

Posted 2017-07-15T08:20:24.407

Reputation: 14 141

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 – 2017-07-15T18:08:43.420