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  bool initRoot(const std::string &root_raw);
15  bool verifyRoot(const std::string &root_raw);
16  int rootVersion() { return root.version(); }
17  bool rootExpired() { return root.isExpired(TimeStamp::Now()); }
18  virtual bool updateMeta(INvStorage &storage, const IMetadataFetcher &fetcher) = 0;
19 
20  protected:
21  void resetRoot();
22  bool 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
Uptane::RepositoryCommon
Definition: uptanerepository.h:10
Uptane::IMetadataFetcher
Definition: fetcher.h:16
Uptane::RepositoryType
Definition: tuf.h:20
Uptane::Root
Definition: tuf.h:384
Uptane
Base data types that are used in The Update Framework (TUF), part of UPTANE.
Definition: secondary_tcp_server.h:8
INvStorage
Definition: invstorage.h:126