aboutsummaryrefslogtreecommitdiff
path: root/include/Signature.hpp
diff options
context:
space:
mode:
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;