aboutsummaryrefslogtreecommitdiff
path: root/include/Signature.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-03-09 10:26:55 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit0e62cb8e5ed06d906ad84321cdda22acfcc952c9 (patch)
tree9ba0cc8e20febb4bf07d4d065e3d653ed651bdda /include/Signature.hpp
parenteda9a7bbefc5587bf1ff895a9214f450e64575fa (diff)
Partially implement 'add' operation
Diffstat (limited to 'include/Signature.hpp')
-rw-r--r--include/Signature.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/Signature.hpp b/include/Signature.hpp
index aace383..62c41c3 100644
--- a/include/Signature.hpp
+++ b/include/Signature.hpp
@@ -2,6 +2,7 @@
#include "DataView.hpp"
#include <stdexcept>
+#include <unordered_map>
namespace odhtdb
{
@@ -67,6 +68,9 @@ namespace odhtdb
// Both exceptions are derived from UnsignException
std::string unsign(const DataView &signedMessage) const;
+ size_t operator()() const;
+ bool operator==(const PublicKey &other) const;
+
std::string toString() const;
private:
PublicKey(){}
@@ -74,6 +78,17 @@ namespace odhtdb
char data[PUBLIC_KEY_NUM_BYTES];
};
+ struct PublicKeyHasher
+ {
+ size_t operator()(const PublicKey &publicKey) const
+ {
+ return publicKey();
+ }
+ };
+
+ template <typename ValueType>
+ using MapPublicKey = std::unordered_map<PublicKey, ValueType, PublicKeyHasher>;
+
class PrivateKey
{
friend class KeyPair;