29 immer::map<std::string, std::string>
keys;
35 immer::map<std::string, immer::map<std::string, std::string>>
signatures;
47 if (! jo.is_object()) { jo = json::object(); }
50 jo[
"user_id"s] = pod.
userId;
56 jo[
"keys"s] = pod.
keys;
64 if (jo.contains(
"user_id"s)) {
65 result.
userId = jo.at(
"user_id"s);
67 if (jo.contains(
"device_id"s)) {
68 result.
deviceId = jo.at(
"device_id"s);
70 if (jo.contains(
"algorithms"s)) {
73 if (jo.contains(
"keys"s)) {
74 result.
keys = jo.at(
"keys"s);
76 if (jo.contains(
"signatures"s)) {
Definition: location.hpp:10
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Device identity keys.
Definition: device_keys.hpp:13
std::string deviceId
The ID of the device these keys belong to.
Definition: device_keys.hpp:21
immer::map< std::string, immer::map< std::string, std::string > > signatures
Signatures for the device key object.
Definition: device_keys.hpp:35
std::string userId
The ID of the user the device belongs to.
Definition: device_keys.hpp:17
immer::map< std::string, std::string > keys
Public identity keys.
Definition: device_keys.hpp:29
immer::array< std::string > algorithms
The encryption algorithms supported by this device.
Definition: device_keys.hpp:24
static void from_json(const json &jo, DeviceKeys &result)
Definition: device_keys.hpp:61
static void to_json(json &jo, const DeviceKeys &pod)
Definition: device_keys.hpp:45