From 6a6d2a27648490f08aaf0759a533aef08b32070d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Tue, 3 Nov 2020 08:59:54 +0100 Subject: cpp: Make signatures belonging to the same user ID sortable lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<): New. lang/cpp/src/key.cpp (signature_index): New. -- operator< defines a canonical sort order for signatures belonging to the same user ID. It is based on the sort order defined by cmp_signodes() in g10/keylist.c of gnupg. In particular, the ordering of signatures made with the same key by creation time allows to see easily whether the most recent signature is a certification or a revocation. GnuPG-bug-id: 5094 recent --- lang/cpp/src/key.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/cpp/src/key.h') diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index d3c6125a..a7931672 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -467,6 +467,9 @@ public: swap(this->sig, other.sig); } + /*! Defines a canonical sort order for signatures of the same user ID. */ + bool operator<(const Signature &other); + bool isNull() const { return !sig || !uid || !key ; -- cgit v1.2.3