From e416f9961837039f259558edf41fccbc181ad128 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 11 Jan 2017 16:14:45 +0100 Subject: cpp: Add revuid and adduid support * lang/cpp/src/context.cpp (Context::revUid, Context::startRevUid), (Context::addUid, Context::startAddUid): New. * lang/cpp/src/context.h: Declare new functions. * lang/cpp/src/key.cpp (Key::UserID::revoke) (Key::addUid): Idomatic helpers. lang/cpp/src/key.h: Declare new functions. * NEWS: Update accordingly. --- lang/cpp/src/key.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 3f596a82..b0599c7f 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -152,6 +152,17 @@ public: * how long the keylisting takes.*/ void update(); + /** + * @brief Add a user id to this key. + * + * Needs gnupg 2.1.13 and the key needs to be updated + * afterwards to see the new uid. + * + * @param uid should be fully formated and UTF-8 encoded. + * + * @returns a possible error. + **/ + Error addUid(const char *uid); private: gpgme_key_t impl() const { @@ -335,6 +346,13 @@ public: * @returns a normalized mail address for this userid * or an empty string. */ std::string addrSpec() const; + + /*! Revoke the user id. + * + * Key needs update afterwards. + * + * @returns an error on error.*/ + Error revoke(); private: shared_gpgme_key_t key; gpgme_user_id_t uid; -- cgit v1.2.3