aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/key.cpp
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2019-11-04 12:54:55 +0000
committerAndre Heinecke <[email protected]>2019-11-04 12:54:55 +0000
commitcb7668caeb71429afce1aded9128334182b233e1 (patch)
treedaf8c5defff1c3753a68b726a80baeefcbd7db76 /lang/cpp/src/key.cpp
parentqt,tests: Move remarks test out and extend it (diff)
downloadgpgme-cb7668caeb71429afce1aded9128334182b233e1.tar.gz
gpgme-cb7668caeb71429afce1aded9128334182b233e1.zip
cpp: Add API to obtain mutliple remarks
* lang/cpp/src/key.cpp, lang/cpp/src/key.h (UserID::remarks): New. * NEWS: Mention this. -- This can be useful if we want to show remarks made by others, too. For: GnuPG-Bug-Id: T4734
Diffstat (limited to 'lang/cpp/src/key.cpp')
-rw-r--r--lang/cpp/src/key.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp
index e2d91a10..5108a6ee 100644
--- a/lang/cpp/src/key.cpp
+++ b/lang/cpp/src/key.cpp
@@ -777,6 +777,22 @@ const char *UserID::remark(const Key &remarker, Error &err) const
return nullptr;
}
+std::vector<std::string> UserID::remarks(std::vector<Key> keys, Error &err) const
+{
+ std::vector<std::string> ret;
+
+ for (const auto &key: keys) {
+ const char *rem = remark(key, err);
+ if (err) {
+ return ret;
+ }
+ if (rem) {
+ ret.push_back(rem);
+ }
+ }
+ return ret;
+}
+
//
//
// class Signature