"Likewise, please don’t make the behavior of a command-line program depend on the type of output device it gets as standard output or standard input."
Actually, ideally GPG public keys would be small enough that they could be inlined with the script. Why is it that a SSH public key are on a single line but GPG have to be a page-full?
A GPG public key does not only consist of the integer number that forms the cryptographic public key, but usually you have multiple user IDs so other can recognize to whom this key belongs. In order to prove that these user ID belongs to this public key, each of them is signed. Obviously, that will take a few more bytes for the additional data and signature.
The exported file size also depends on the way you export the GPG public key. By default, you will also export all signatures made by others, but you can use `gpg --export --export-options=export-minimal` to strip everything except the last self-signature on each user ID.
Thinking about this I came up with the following. I tried getting the fingerprint in full but only got the short version. Not being a gpg-ninja it would suffice to make an offline version of the add command.
... and then you have to check the fingerprints manually, and delete the ones you don't want manually.
No, what would really solve this specific issue is allowing apt-key to add only a single key, and give it the expected fingerprint (as zimbatm explains)
> providing instructions on adding the key to apt-key
curl | apt-key - # that works
No really, they shouldn't tell you how to add the key to your store. If you don't know how to do that yourself, you shouldn't be admin/superuser. (Also, `man`)
That's the downside of everything-is-just-strings in Unix