19 immer::array<std::string>
usage;
24 immer::map<std::string, std::string>
keys;
41 if (! jo.is_object()) { jo = json::object(); }
44 jo[
"user_id"s] = pod.
userId;
46 jo[
"usage"s] = pod.
usage;
48 jo[
"keys"s] = pod.
keys;
56 if (jo.contains(
"user_id"s)) {
57 result.
userId = jo.at(
"user_id"s);
59 if (jo.contains(
"usage"s)) {
60 result.
usage = jo.at(
"usage"s);
62 if (jo.contains(
"keys"s)) {
63 result.
keys = jo.at(
"keys"s);
65 if (jo.contains(
"signatures"s)) {
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Cross signing key.
Definition: cross_signing_key.hpp:13
immer::map< std::string, std::string > keys
The public key.
Definition: cross_signing_key.hpp:24
std::string userId
The ID of the user the key belongs to.
Definition: cross_signing_key.hpp:16
immer::array< std::string > usage
What the key is used for.
Definition: cross_signing_key.hpp:19
JsonWrap signatures
Signatures of the key, calculated using the process described at Signing JSON.
Definition: cross_signing_key.hpp:29
static void to_json(json &jo, const CrossSigningKey &pod)
Definition: cross_signing_key.hpp:39
static void from_json(const json &jo, CrossSigningKey &result)
Definition: cross_signing_key.hpp:53