Aktualizr
C++ SOTA Client
uptane_repo.h
1 #ifndef UPTANE_REPO_H_
2 #define UPTANE_REPO_H_
3 
4 #include "director_repo.h"
5 #include "image_repo.h"
6 
7 class UptaneRepo {
8  public:
9  UptaneRepo(const boost::filesystem::path &path, const std::string &expires, const std::string &correlation_id);
10  void generateRepo(KeyType key_type = KeyType::kRSA2048);
11  void addTarget(const std::string &target_name, const std::string &hardware_id, const std::string &ecu_serial,
12  const std::string &url, const std::string &expires = "");
13  void addImage(const boost::filesystem::path &image_path, const boost::filesystem::path &targetname,
14  const std::string &hardware_id, const std::string &url, const Delegation &delegation);
15  void addDelegation(const Uptane::Role &name, const Uptane::Role &parent_role, const std::string &path,
16  bool terminating, KeyType key_type);
17  void revokeDelegation(const Uptane::Role &name);
18  void addCustomImage(const std::string &name, const Hash &hash, uint64_t length, const std::string &hardware_id,
19  const std::string &url, const Delegation &delegation = {}, const Json::Value &custom = {});
20  void signTargets();
21  void emptyTargets();
22  void oldTargets();
23  void generateCampaigns();
24  void refresh(Uptane::RepositoryType repo_type, const Uptane::Role &role);
25 
26  private:
27  DirectorRepo director_repo_;
28  ImageRepo image_repo_;
29 };
30 
31 #endif // UPTANE_REPO_H_
Hash
The Hash class The hash of a file or Uptane metadata.
Definition: types.h:159
Uptane::RepositoryType
Definition: tuf.h:21
DirectorRepo
Definition: director_repo.h:6
Uptane::Role
TUF Roles.
Definition: tuf.h:61
UptaneRepo
Definition: uptane_repo.h:7
Delegation
Definition: repo.h:19
ImageRepo
Definition: image_repo.h:6