summaryrefslogtreecommitdiff
path: root/src/identity.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/identity.h')
-rw-r--r--src/identity.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/identity.h b/src/identity.h
new file mode 100644
index 0000000..d31951f
--- /dev/null
+++ b/src/identity.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <erebos/identity.h>
+#include "pubkey.h"
+
+using std::function;
+using std::optional;
+using std::string;
+using std::vector;
+
+namespace erebos {
+
+class IdentityData
+{
+public:
+ static optional<IdentityData> load(const Ref &);
+
+ const vector<Stored<Signed<IdentityData>>> prev;
+ const optional<string> name;
+ const optional<Stored<Signed<IdentityData>>> owner;
+ const Stored<PublicKey> keyIdentity;
+ const optional<Stored<PublicKey>> keyMessage;
+};
+
+class Identity::Priv
+{
+public:
+ vector<Stored<Signed<IdentityData>>> data;
+ shared_future<optional<string>> name;
+ optional<Identity> owner;
+
+ static bool verifySignatures(const Stored<Signed<IdentityData>> & sdata);
+ static shared_ptr<Priv> validate(const vector<Stored<Signed<IdentityData>>> & sdata);
+ optional<Stored<IdentityData>> lookupProperty(
+ function<bool(const IdentityData &)> sel) const;
+};
+
+}