Go to the documentation of this file.
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;
52 jo[
"device_id"s] = pod.deviceId;
54 jo[
"algorithms"s] = pod.algorithms;
56 jo[
"keys"s] = pod.keys;
58 jo[
"signatures"s] = pod.signatures;
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)) {
71 result.algorithms = jo.at(
"algorithms"s);
73 if (jo.contains(
"keys"s)) {
74 result.keys = jo.at(
"keys"s);
76 if (jo.contains(
"signatures"s)) {
77 result.signatures = jo.at(
"signatures"s);
std::string userId
The ID of the user the device belongs to.
Definition: device_keys.hpp:21
static void to_json(json &jo, const DeviceKeys &pod)
Definition: device_keys.hpp:45
Definition: location.hpp:26
immer::map< std::string, immer::map< std::string, std::string > > signatures
Signatures for the device key object.
Definition: device_keys.hpp:39
Definition: location.hpp:10
Device identity keys.
Definition: device_keys.hpp:14
immer::map< std::string, std::string > keys
Public identity keys.
Definition: device_keys.hpp:33
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:10
static void from_json(const json &jo, DeviceKeys &result)
Definition: device_keys.hpp:61
std::string deviceId
The ID of the device these keys belong to.
Definition: device_keys.hpp:25
immer::array< std::string > algorithms
The encryption algorithms supported by this device.
Definition: device_keys.hpp:28