cpp: Add support for gpgme_op_set_uid_flag

* lang/cpp/src/context.cpp, lang/cpp/src/context.h
(Context::setPrimaryUid, Context::startSetPrimaryUid): New.
--

GnuPG-bug-id: 5938
This commit is contained in:
Ingo Klöcker 2022-08-09 09:35:19 +02:00
parent f8d99bb9e4
commit 125867f268
3 changed files with 17 additions and 0 deletions

4
NEWS
View File

@ -7,6 +7,8 @@ Noteworthy changes in version 1.17.2 (unreleased)
* cpp, qt: Support revocation of own OpenPGP keys. [#5904]
* cpp: Support setting the primary user ID. [#5938]
* Interface changes relative to the 1.17.1 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GPGME_KEYLIST_MODE_FORCE_EXTERN NEW.
@ -17,6 +19,8 @@ Noteworthy changes in version 1.17.2 (unreleased)
cpp: KeyListMode::ForceExtern NEW.
cpp: KeyListMode::LocateExternal NEW.
cpp: KeyListMode::KeyListModeMask NEW.
cpp: Context::setPrimaryUid NEW.
cpp: Context::startSetPrimaryUid NEW.
qt: RevokeKeyJob NEW.
qt: Protocol::revokeKeyJob NEW.

View File

@ -1641,6 +1641,16 @@ Error Context::startRevUid(const Key &k, const char *userid)
k.impl(), userid, 0));
}
Error Context::setPrimaryUid(const Key &k, const char *userid)
{
return Error(d->lasterr = gpgme_op_set_uid_flag(d->ctx, k.impl(), userid, "primary", nullptr));
}
Error Context::startSetPrimaryUid(const Key &k, const char *userid)
{
return Error(d->lasterr = gpgme_op_set_uid_flag_start(d->ctx, k.impl(), userid, "primary", nullptr));
}
Error Context::createSubkey(const Key &k, const char *algo,
unsigned long reserved,
unsigned long expires,

View File

@ -295,6 +295,9 @@ public:
Error revUid(const Key &key, const char *userid);
Error startRevUid(const Key &key, const char *userid);
Error setPrimaryUid(const Key &key, const char *userid);
Error startSetPrimaryUid(const Key &key, const char *userid);
Error createSubkey(const Key &key, const char *algo,
unsigned long reserved = 0,
unsigned long expires = 0,