Mailing List Archive

[issue213] gpgme: add int gpgme_key_is_root(cert)( gpgme_key_t * )
New submission from Marc Mutz <marc@klaralvdalens-datakonsult.se>:

This is to make it easier for the user of gpgme to determine whether a given
key is a root certificate. An alternative would be to add an is_root flag in
gpgme_key_t, but you are right in that this would duplicate information already
available through the chain_id (albeit needing a string comparison). I've
implemented this in gpgme++ like this:

bool Key::isRoot() const {
return d->key && d->key->subkeys && d->key->subkeys->fpr && d->key->chain
_id &&
strcasecmp( d->key->subkeys->fpr, d->key->chain_id ) == 0;
}

----------
assignedto: marcus
messages: 1054
nosy: marc, marcus
priority: wish
status: unread
title: gpgme: add int gpgme_key_is_root(cert)( gpgme_key_t * )
topic: GPGME
______________________________________________________
Aegypten issue tracker <aegypten-issues@intevation.de>
<https://intevation.de/roundup/aegypten/issue213>
______________________________________________________