1 #include "logging/logging.h" 2 #include "uptane/exceptions.h" 3 #include "uptane/tuf.h" 7 Root::Root(
const RepositoryType repo,
const Json::Value &json,
Root &root) :
Root(repo, json) {
13 if (!json[
"signed"].isMember(
"keys")) {
15 }
else if (!json[
"signed"].isMember(
"roles")) {
19 const Json::Value keys = json[
"signed"][
"keys"];
20 ParseKeys(repo, keys);
22 const Json::Value roles = json[
"signed"][
"roles"];
23 for (
auto it = roles.begin(); it != roles.end(); it++) {
24 const Role role =
Role(it.key().asString());
25 ParseRole(repo, it, role,
"root");
30 const std::string repository = repo;
32 if (policy_ == Policy::kAcceptAll) {
35 if (policy_ == Policy::kRejectAll) {
38 assert(policy_ == Policy::kCheck);
Root(Policy policy=Policy::kRejectAll)
An empty Root, that either accepts or rejects everything.
void UnpackSignedObject(RepositoryType repo, const Role &role, const Json::Value &signed_object) override
Take a JSON blob that contains a signatures/signed component that is supposedly for a given role...