24 #include <unordered_map> 76 virtual void encrypt(std::shared_ptr<const std::string> recipientUserId, std::shared_ptr<std::vector<RecipientData>> recipients, std::shared_ptr<
const std::vector<uint8_t>> plainMessage,
const lime::EncryptionPolicy encryptionPolicy, std::shared_ptr<std::vector<uint8_t>>
cipherMessage,
const limeCallback &callback) = 0;
90 virtual lime::PeerDeviceStatus decrypt(
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) = 0;
137 virtual void update_OPk(
const limeCallback &callback, uint16_t OPkServerLowLimit, uint16_t OPkBatchSize) = 0;
144 virtual void get_Ik(std::vector<uint8_t> &Ik) = 0;
175 std::shared_ptr<LimeGeneric>
insert_LimeUser(
const std::string &dbFilename,
const std::string &deviceId,
const std::string &url,
const lime::CurveId curve,
const uint16_t OPkInitialBatchSize,
178 std::shared_ptr<LimeGeneric>
load_LimeUser(
const std::string &dbFilename,
const std::string &deviceId,
const limeX3DHServerPostData &X3DH_post_data, std::shared_ptr<std::recursive_mutex> mutex,
const bool allStatus=
false);
181 #endif // lime_lime_hpp virtual ~LimeGeneric()
Definition: lime_lime.hpp:170
virtual void stale_sessions(const std::string &peerDeviceId)=0
Stale all sessions between localDeviceId and peerDevice. If peerDevice keep using this session to enc...
virtual void set_x3dhServerUrl(const std::string &x3dhServerUrl)=0
Set the X3DH key server URL for this identified user.
std::shared_ptr< LimeGeneric > insert_LimeUser(const std::string &dbFilename, const std::string &deviceId, const std::string &url, const lime::CurveId curve, const uint16_t OPkInitialBatchSize, const limeX3DHServerPostData &X3DH_post_data, const limeCallback &callback, std::shared_ptr< std::recursive_mutex > db_mutex)
: Insert user in database and return a pointer to the control class instanciating the appropriate Lim...
Definition: lime.cpp:390
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:115
std::function< void(const lime::CallbackReturn status, const std::string message)> limeCallback
Callback use to give a status on asynchronous operation.
Definition: lime.hpp:95
virtual void get_Ik(std::vector< uint8_t > &Ik)=0
Retrieve self public Identity key.
std::shared_ptr< LimeGeneric > load_LimeUser(const std::string &dbFilename, const std::string &deviceId, const limeX3DHServerPostData &X3DH_post_data, std::shared_ptr< std::recursive_mutex > db_mutex, const bool allStatus)
: Load user from database and return a pointer to the control class instanciating the appropriate Lim...
Definition: lime.cpp:457
PeerDeviceStatus
Definition: lime.hpp:53
virtual void update_SPk(const limeCallback &callback)=0
Check if the current SPk needs to be updated, if yes, generate a new one and publish it on server...
virtual std::string get_x3dhServerUrl()=0
Get the X3DH key server URL for this identified user.
virtual void delete_peerDevice(const std::string &peerDeviceId)=0
Purge cached sessions for a given peer Device (used when a peer device is being deleted) ...
virtual void publish_user(const limeCallback &callback, const uint16_t OPkInitialBatchSize)=0
Publish on X3DH server the user, it is performed just after creation in local storage this will...
virtual void update_OPk(const limeCallback &callback, uint16_t OPkServerLowLimit, uint16_t OPkBatchSize)=0
check if we shall upload more OPks on X3DH server
EncryptionPolicy
Definition: lime.hpp:41
CurveId
Definition: lime.hpp:34
virtual lime::PeerDeviceStatus decrypt(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)=0
Decrypt the given message.
virtual void encrypt(std::shared_ptr< const std::string > recipientUserId, std::shared_ptr< std::vector< RecipientData >> recipients, std::shared_ptr< const std::vector< uint8_t >> plainMessage, const lime::EncryptionPolicy encryptionPolicy, std::shared_ptr< std::vector< uint8_t >> cipherMessage, const limeCallback &callback)=0
Encrypt a buffer(text or file) for a given list of recipient devices if specified localDeviceId is no...
A pure abstract class defining the API to encrypt/decrypt/manage user and its keys.
Definition: lime_lime.hpp:35
virtual void delete_user(const limeCallback &callback)=0
Delete user from local Storage and from X3DH server.