From 54f94b14e2bb9b38ffd89f509406bfbd012da632 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 11 Oct 2016 14:13:15 +0200 Subject: cpp: Add API for gpgme_addrspec_from_uid * lang/cpp/src/key.cpp (UserID::addrSpecFromString): New static function to expose addrspec from uid. (UserID::addrSpec): New. Get addrSpec from Userid. * NEWS: Update accordingly. --- lang/cpp/src/key.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index f193093c..3f596a82 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -320,6 +320,21 @@ public: * @returns The TOFU stats or a null TofuInfo. */ GpgME::TofuInfo tofuInfo() const; + + /*! Wrapper around gpgme_addrspec_from_uid. + * + * The input string should match the format of + * a user id string. + * + * @returns a normalized mail address if found + * or an empty string. */ + static std::string addrSpecFromString(const char *uid); + + /*! Wrapper around gpgme_addrspec_from_uid. + * + * @returns a normalized mail address for this userid + * or an empty string. */ + std::string addrSpec() const; private: shared_gpgme_key_t key; gpgme_user_id_t uid; -- cgit v1.2.3