23 #include <unordered_map> 96 using limeCallback = std::function<void(const lime::CallbackReturn status, const std::string message)>;
130 std::unordered_map<std::string, std::shared_ptr<LimeGeneric>> m_users_cache;
131 std::mutex m_users_mutex;
132 std::shared_ptr<lime::Db> m_localStorage;
134 void load_user(std::shared_ptr<LimeGeneric> &user,
const std::string &localDeviceId,
const bool allStatus=
false);
155 void create_user(
const std::string &localDeviceId,
const std::string &x3dhServerUrl,
const lime::CurveId curve,
const uint16_t OPkInitialBatchSize,
const limeCallback &callback);
159 void create_user(
const std::string &localDeviceId,
const std::string &x3dhServerUrl,
const lime::CurveId curve,
const limeCallback &callback);
170 void delete_user(
const std::string &localDeviceId,
const limeCallback &callback);
179 bool is_user(
const std::string &localDeviceId);
238 lime::PeerDeviceStatus decrypt(
const std::string &localDeviceId,
const std::string &recipientUserId,
const std::string &senderDeviceId,
const std::vector<uint8_t> &DRmessage,
const std::vector<uint8_t> &
cipherMessage, std::vector<uint8_t> &plainMessage);
243 lime::PeerDeviceStatus decrypt(
const std::string &localDeviceId,
const std::string &recipientUserId,
const std::string &senderDeviceId,
const std::vector<uint8_t> &DRmessage, std::vector<uint8_t> &plainMessage);
264 void update(
const std::string &localDeviceId,
const limeCallback &callback, uint16_t OPkServerLowLimit, uint16_t OPkBatchSize);
268 void update(
const std::string &localDeviceId,
const limeCallback &callback);
279 void get_selfIdentityKey(
const std::string &localDeviceId, std::vector<uint8_t> &Ik);
309 void set_peerDeviceStatus(
const std::string &peerDeviceId,
const std::vector<uint8_t> &Ik,
lime::PeerDeviceStatus status);
355 bool is_localUser(
const std::string &deviceId);
364 void delete_peerDevice(
const std::string &peerDeviceId);
375 void stale_sessions(
const std::string &localDeviceId,
const std::string &peerDeviceId);
385 void set_x3dhServerUrl(
const std::string &localDeviceId,
const std::string &x3dhServerUrl);
396 std::string get_x3dhServerUrl(
const std::string &localDeviceId);
std::vector< uint8_t > DRmessage
Definition: lime.hpp:76
CallbackReturn
Definition: lime.hpp:85
RecipientData(const std::string &deviceId)
Definition: lime.hpp:81
std::function< void(int responseCode, const std::vector< uint8_t > &responseBody)> limeX3DHServerResponseProcess
Get the response from server. The external service providing secure communication to the X3DH server ...
Definition: lime.hpp:106
std::function< void(const std::string &url, const std::string &from, const std::vector< uint8_t > &message, const limeX3DHServerResponseProcess &reponseProcess)> limeX3DHServerPostData
Post a message to the X3DH server.
Definition: lime.hpp:116
lime::PeerDeviceStatus peerStatus
Definition: lime.hpp:70
std::function< void(const lime::CallbackReturn status, const std::string message)> limeCallback
Callback use to give a status on asynchronous operation.
Definition: lime.hpp:96
PeerDeviceStatus
Definition: lime.hpp:54
static bool decrypt(const lime::DRMKey &MK, const std::vector< uint8_t > &ciphertext, const size_t headerSize, std::vector< uint8_t > &AD, std::vector< uint8_t > &plaintext)
Decrypt as described is spec section 3.1.
Definition: lime_double_ratchet.cpp:99
The encrypt function input/output data structure.
Definition: lime.hpp:68
Database access class.
Definition: lime_localStorage.hpp:34
EncryptionPolicy
Definition: lime.hpp:42
CurveId
Definition: lime.hpp:35
Manage several Lime objects(one is needed for each local user).
Definition: lime.hpp:128
A pure abstract class defining the API to encrypt/decrypt/manage user and its keys.
Definition: lime_lime.hpp:35
const std::string deviceId
Definition: lime.hpp:69