1 #ifndef UPTANE_MANAGEDSECONDARY_H_ 2 #define UPTANE_MANAGEDSECONDARY_H_ 8 #include <boost/filesystem.hpp> 11 #include "uptane/secondaryconfig.h" 12 #include "uptane/secondaryinterface.h" 26 if (!sconfig.ecu_serial.empty()) {
31 PublicKey getPublicKey()
override {
return public_key_; }
32 bool putMetadata(
const RawMetaPack& meta_pack)
override;
33 int getRootVersion(
bool director)
override;
34 bool putRoot(
const std::string& root,
bool director)
override;
36 bool sendFirmwareAsync(
const std::shared_ptr<std::string>&
data)
override;
37 Json::Value getManifest()
override;
39 bool loadKeys(std::string* pub_key, std::string* priv_key);
43 std::string private_key;
45 std::string detected_attack;
46 std::string expected_target_name;
47 std::vector<Hash> expected_target_hashes;
48 int64_t expected_target_length{};
52 std::future<bool> install_future;
54 virtual bool storeFirmware(
const std::string& target_name,
const std::string& content) = 0;
55 virtual bool getFirmwareInfo(std::string* target_name,
size_t& target_len, std::string* sha256hash) = 0;
57 void storeKeys(
const std::string& pub_key,
const std::string& priv_key);
61 void storeMetadata(
const RawMetaPack& meta_pack) { (void)meta_pack; }
63 bool sendFirmware(
const std::shared_ptr<std::string>&
data);
67 #endif // UPTANE_MANAGEDSECONDARY_H_
Base data types that are used in The Update Framework (TUF), part of UPTANE.