Mailing List Archive

[issue214] gpgme: add gpgme_key_t->fpr
New submission from Marc Mutz <marc@klaralvdalens-datakonsult.se>:

Whenever I need to identify a key I'm told to use "the fingerprint". E.g. when
saving the preferred signing key for an identity to a config file, or when
trying to determine whether or not a given key represents a root certificate.
Whenever I do key->subkeys->fpr, therefore, I do wonder why it isn't
key->subkeys->next->fpr that I should use. What happens if the first subkey is
deleted from a key, or revoked? This looks even more curious in gpgme++:
const char * fpr = key.subkey(0).fingerprint(); // why _0_?
I therefore added Key::primaryFingerprint() to gpgme++, to hide this particular
question-raising-whenever-reading-the-code. Maybe much of the need for this
could go away when some functions in gpgme took gpgme_key_t's instead of const
char *, see e.g. #213, and esp. a gpgme_op_keylist_* variant.

----------
assignedto: marcus
messages: 1055
nosy: marc, marcus
priority: wish
status: unread
title: gpgme: add gpgme_key_t->fpr
topic: GPGME
______________________________________________________
Aegypten issue tracker <aegypten-issues@intevation.de>
<https://intevation.de/roundup/aegypten/issue214>
______________________________________________________
Re: [issue214] gpgme: add gpgme_key_t->fpr [ In reply to ]
On Sat, 05 Jun 2004 12:41:52 +0000, Marc Mutz said:

key-> subkeys->next->fpr that I should use. What happens if the first subkey is
> deleted from a key, or revoked? This looks even more curious in gpgme++:

Subkeys are only used by OpenPGP and an OpenPGP application handles
them transparently - i.e. a user does not need to care about it. All
he has to know is the fingerprint which is technically the one of the
primary key.

It is intentionally that only the primary key is used and furthermore,
even if you speicify a subkey, gpg will just use thar one to locate
the primary key and use it. There is an algorithm to decide whether
the primary key or one of the subkeys will actully be used. This all
works automagically and allows for automatic key roll over.


Salam-Shalom,

Werner