From a16b33031c7bcf2eabf1e0c3571000234b7740df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 24 Jan 2021 22:46:48 +0100 Subject: Attach service --- include/erebos/attach.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 include/erebos/attach.h (limited to 'include/erebos/attach.h') diff --git a/include/erebos/attach.h b/include/erebos/attach.h new file mode 100644 index 0000000..14e6af3 --- /dev/null +++ b/include/erebos/attach.h @@ -0,0 +1,49 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include + +namespace erebos { + +using std::mutex; +using std::optional; +using std::promise; +using std::string; +using std::vector; + +struct AttachIdentity; + +class AttachService : public PairingService +{ +public: + AttachService(); + virtual ~AttachService(); + + UUID uuid() const override; + + void attachTo(const Peer &); + +protected: + virtual Stored handlePairingComplete(const Peer &) override; + virtual void handlePairingResult(Context &, Stored) override; + + mutex handlerLock; +}; + +template class Signed; + +struct AttachIdentity +{ + Stored> identity; + vector> keys; + + static AttachIdentity load(const Ref &); + Ref store(const Storage &) const; +}; + +} -- cgit v1.2.3