From 0adaf7bafd352f1c3a1e797493780150e3bb0adc Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 19 Apr 2018 10:44:01 +0200 Subject: cpp: Add origin and last_update * NEWS: mention interface change. * lang/cpp/src/key.cpp (Key::origin, Key::lastUpdate): New. * lang/cpp/src/key.h (Key::Origin): New enum. --- lang/cpp/src/key.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index c3c711c1..07ddc256 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -178,6 +178,27 @@ public: */ static Key locate(const char *mbox); + /* @enum Origin + * @brief The Origin of the key. */ + enum Origin : unsigned int { + OriginUnknown = 0, + OriginKS = 1, + OriginDane = 3, + OriginWKD = 4, + OriginURL = 5, + OriginFile = 6, + OriginSelf = 7, + OriginOther = 31, + }; + /*! Get the origin of the key. + * + * @returns the Origin. */ + Origin origin() const; + + /*! Get the last update time. + * + * @returns the last update time. */ + time_t lastUpdate() const; private: gpgme_key_t impl() const { -- cgit v1.2.3 From d65d6329319bff8cc555999fc92a20e151762a10 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 19 Apr 2018 11:56:15 +0200 Subject: cpp: Add origin and last_update to UserID * NEWS: Mention it. * lang/cpp/src/key.cpp, lang/cpp/src/key.h (UserID::lastUpdate), (UserID::origin): New. (gpgme_origin_to_pp_origin): New helper. --- lang/cpp/src/key.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 07ddc256..76a0d4f4 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -392,6 +392,16 @@ public: * * @returns an error on error.*/ Error revoke(); + + /*! Get the origin of the key. + * + * @returns the Origin. */ + Key::Origin origin() const; + + /*! Get the last update time. + * + * @returns the last update time. */ + time_t lastUpdate() const; private: shared_gpgme_key_t key; gpgme_user_id_t uid; -- cgit v1.2.3