How can a public key contain several public keys with GPG (or what am I doing wrong)?
2
votes
1
answer
4303
views
I'm setting up some Ubuntu servers. I received from another sysadmin a key to be added (call it
somekey.pub
) for apt package verification on in-house packages.
Adding this key with apt-key add somekey.pub
results in TWO additional entries showing in apt-key list
, each with a "pub" line and a "sub" line. (The "uid" line on both new entries is the sysadmin who gave me the key.)
How is this possible? Inspecting the key with less
shows:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
(41 lines snipped)
-----END PGP PUBLIC KEY BLOCK-----
I also used gpg
to create a keyring containing just that key (using gpg --no-default-keyring --keyring ./somekeyring.gpg --import somekey.pub
), so that I could put the keyring in /etc/apt/trusted.gpg.d/
on other Ubuntu servers rather than running the apt-key add
command.
Inspecting this keyring with gpg --no-default-keyring --keyring ./somekeyring.gpg --list-keys
confirms that it has two keys. Here is the output, munged slightly:
pub 1024R/4AAAAAAA 2018-08-31
uid Joe Sysadmin (Ubuntu Dev Repo Key)
sub 1024R/9FFFFFFF 2018-08-31
pub 2048R/BAAAAAAA 2018-08-31
uid Joe Sysadmin (Ubuntu Repo Repo Key)
sub 2048R/1EEEEEEE 2018-08-31
This is my first foray into GPG and apt keys, so I may be missing some simple basic piece of information, but I would expect that the single public key block in somekey.pub
would only contain a single public key - so the above results surprised me.
Where is the documentation that will allow me to make sense of this?
Asked by Wildcard
(37446 rep)
Sep 7, 2018, 10:48 PM
Last activity: Sep 8, 2018, 06:12 AM
Last activity: Sep 8, 2018, 06:12 AM