Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
uptanerepository.h
1 #ifndef UPTANE_REPOSITORY_H_
2 #define UPTANE_REPOSITORY_H_
3 
4 #include "fetcher.h"
5 
6 class INvStorage;
7 
8 namespace Uptane {
9 
11  public:
12  RepositoryCommon(RepositoryType type_in) : type{type_in} {}
13  virtual ~RepositoryCommon() = default;
14  void initRoot(RepositoryType repo_type, const std::string &root_raw);
15  void verifyRoot(const std::string &root_raw);
16  int rootVersion() { return root.version(); }
17  bool rootExpired() { return root.isExpired(TimeStamp::Now()); }
18  virtual void updateMeta(INvStorage &storage, const IMetadataFetcher &fetcher) = 0;
19 
20  protected:
21  void resetRoot();
22  void updateRoot(INvStorage &storage, const IMetadataFetcher &fetcher, RepositoryType repo_type);
23 
24  static const int64_t kMaxRotations = 1000;
25 
26  Root root;
27  RepositoryType type;
28 };
29 } // namespace Uptane
30 
31 #endif
Base data types that are used in The Update Framework (TUF), part of Uptane.
Definition: types.h:304