summaryrefslogtreecommitdiff
path: root/include/erebos/identity.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-12-03 22:52:26 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2023-12-06 21:39:48 +0100
commite4b5eb30af94991e19ac324d5e6ec616e6a71d36 (patch)
tree9f24da69308d98e5fe980602cb67e6b11600eff5 /include/erebos/identity.h
parent40230a02c0630be311fb27aa68cd5e441801e67d (diff)
Contacts with extended identity
Diffstat (limited to 'include/erebos/identity.h')
-rw-r--r--include/erebos/identity.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/erebos/identity.h b/include/erebos/identity.h
index 7829361..4792330 100644
--- a/include/erebos/identity.h
+++ b/include/erebos/identity.h
@@ -71,6 +71,37 @@ private:
Identity(std::shared_ptr<const Priv> && p);
};
+struct IdentityData;
+struct IdentityExtension;
+
+struct StoredIdentityPart
+{
+ using Part = variant<
+ Stored<Signed<IdentityData>>,
+ Stored<Signed<IdentityExtension>>>;
+
+ StoredIdentityPart(Part p): part(move(p)) {}
+
+ static StoredIdentityPart load(const Ref &);
+ Ref store(const Storage & st) const;
+
+ bool operator==(const StoredIdentityPart & other) const
+ { return part == other.part; }
+ bool operator<(const StoredIdentityPart & other) const
+ { return part < other.part; }
+
+ const Ref & ref() const;
+ const Stored<Signed<IdentityData>> & base() const;
+
+ vector<StoredIdentityPart> previous() const;
+ vector<Digest> roots() const;
+ optional<string> name() const;
+ optional<StoredIdentityPart> owner() const;
+ bool isSignedBy(const Stored<PublicKey> &) const;
+
+ Part part;
+};
+
DECLARE_SHARED_TYPE(optional<Identity>)
}