Aktualizr
C++ SOTA Client
imagesrepository.h
1 #ifndef IMAGES_REPOSITORY_H_
2 #define IMAGES_REPOSITORY_H_
3 
4 #include "uptanerepository.h"
5 
6 namespace Uptane {
7 
9  public:
10  ImagesRepository() : RepositoryCommon(RepositoryType::Images) {}
11 
12  void resetMeta();
13 
14  bool verifyTargets(const std::string& targets_raw);
15  bool targetsExpired() { return targets.isExpired(TimeStamp::Now()); }
16  int64_t targetsSize() { return snapshot.targets_size(); }
17  std::unique_ptr<Uptane::Target> getTarget(const Uptane::Target& director_target);
18 
19  bool verifyTimestamp(const std::string& timestamp_raw);
20  bool timestampExpired() { return timestamp.isExpired(TimeStamp::Now()); }
21 
22  bool verifySnapshot(const std::string& snapshot_raw);
23  bool snapshotExpired() { return snapshot.isExpired(TimeStamp::Now()); }
24  int64_t snapshotSize() { return timestamp.snapshot_size(); }
25 
26  Exception getLastException() const { return last_exception; }
27 
28  private:
29  Uptane::Targets targets;
30  Uptane::TimestampMeta timestamp;
31  Uptane::Snapshot snapshot;
32 
33  Exception last_exception{"", ""};
34 };
35 
36 } // namespace Uptane
37 
38 #endif // IMAGES_REPOSITORY_H
Base data types that are used in The Update Framework (TUF), part of UPTANE.