Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
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 Uptane::Hash &hash, uint64_t length,
19  const std::string &hardware_id, const std::string &url, const Delegation &delegation = {},
20  const Json::Value &custom = {});
21  void signTargets();
22  void emptyTargets();
23  void oldTargets();
24  void generateCampaigns();
25  void refresh(Uptane::RepositoryType repo_type, const Uptane::Role &role);
26 
27  private:
28  DirectorRepo director_repo_;
29  ImageRepo image_repo_;
30 };
31 
32 #endif // UPTANE_REPO_H_
Uptane::Hash
The hash of a file or TUF metadata.
Definition: tuf.h:209
Uptane::RepositoryType
Definition: tuf.h:20
DirectorRepo
Definition: director_repo.h:6
Uptane::Role
TUF Roles.
Definition: tuf.h:57
UptaneRepo
Definition: uptane_repo.h:7
Delegation
Definition: repo.h:19
ImageRepo
Definition: image_repo.h:6