20 #ifndef lime_localStorage_hpp 21 #define lime_localStorage_hpp 23 #include "soci/soci.h" 49 Db(
const std::string &filename, std::shared_ptr<std::recursive_mutex> db_mutex);
52 void load_LimeUser(
const std::string &deviceId,
long int &Uid,
lime::CurveId &curveId, std::string &url,
const bool allStatus=
false);
62 template <
typename Curve>
64 template <
typename Curve>
69 #ifdef EC25519_ENABLED bool is_localUser(const std::string &deviceId)
checks if a device Id exists in the local users table
Definition: lime_localStorage.cpp:472
void set_peerDeviceStatus(const std::string &peerDeviceId, const std::vector< uint8_t > &Ik, lime::PeerDeviceStatus status)
set the peer device status flag in local storage: unsafe, trusted or untrusted.
Definition: lime_localStorage.cpp:339
lime::PeerDeviceStatus get_peerDeviceStatus(const std::string &peerDeviceId)
get the status of a peer device: unknown, untrusted, trusted, unsafe
Definition: lime_localStorage.cpp:444
void delete_peerDevice(const std::string &peerDeviceId)
delete a peerDevice from local storage
Definition: lime_localStorage.cpp:486
void clean_DRSessions()
Delete old stale sessions and old stored message key. Apply to all users in localStorage.
Definition: lime_localStorage.cpp:270
void delete_LimeUser(const std::string &deviceId)
if exists, delete user
Definition: lime_localStorage.cpp:590
PeerDeviceStatus
Definition: lime.hpp:53
~Db()
Definition: lime_localStorage.hpp:50
std::shared_ptr< std::recursive_mutex > m_db_mutex
mutex on database access
Definition: lime_localStorage.hpp:39
void load_LimeUser(const std::string &deviceId, long int &Uid, lime::CurveId &curveId, std::string &url, const bool allStatus=false)
Check for existence, retrieve Uid for local user based on its userId (GRUU) and curve from table lime...
Definition: lime_localStorage.cpp:224
void get_allLocalDevices(std::vector< std::string > &deviceIds)
Get a list of deviceIds of all local users present in localStorage.
Definition: lime_localStorage.cpp:297
long int check_peerDevice(const std::string &peerDeviceId, const DSA< Curve, lime::DSAtype::publicKey > &peerIk, const bool updateInvalid=false)
Check peer device information(DeviceId - GRUU -, public Ik, Uid to link it to a user) in local storag...
Definition: lime_localStorage.cpp:503
void clean_SPk()
Delete old stale SPk. Apply to all users in localStorage.
Definition: lime_localStorage.cpp:285
Database access class.
Definition: lime_localStorage.hpp:34
long int store_peerDevice(const std::string &peerDeviceId, const DSA< Curve, lime::DSAtype::publicKey > &peerIk)
Store peer device information(DeviceId - GRUU -, public Ik, Uid to link it to a user) in local storag...
Definition: lime_localStorage.cpp:561
soci::session sql
soci connexion to DB
Definition: lime_localStorage.hpp:37
CurveId
Definition: lime.hpp:34