1 #ifndef PRIMARY_MANAGEDSECONDARY_H_
2 #define PRIMARY_MANAGEDSECONDARY_H_
8 #include <boost/filesystem.hpp>
11 #include "libaktualizr/secondaryinterface.h"
13 #include "primary/secondary_config.h"
24 constexpr
static const char*
const Type =
"managed";
27 bool partial_verifying{
false};
28 std::string ecu_serial;
29 std::string ecu_hardware_id;
30 boost::filesystem::path full_client_dir;
31 std::string ecu_private_key;
32 std::string ecu_public_key;
33 boost::filesystem::path firmware_path;
34 boost::filesystem::path target_name_path;
35 boost::filesystem::path metadata_path;
36 KeyType key_type{KeyType::kRSA2048};
47 void init(std::shared_ptr<SecondaryProvider> secondary_provider_in)
override {
48 secondary_provider_ = std::move(secondary_provider_in);
53 if (!sconfig.ecu_serial.empty()) {
59 PublicKey getPublicKey()
const override {
return public_key_; }
61 int getRootVersion(
bool director)
const override;
69 bool loadKeys(std::string* pub_key, std::string* priv_key);
74 std::shared_ptr<SecondaryProvider> secondary_provider_;
76 std::string detected_attack;
79 void storeKeys(
const std::string& pub_key,
const std::string& priv_key);
83 bool storeMetadata() {
return true; }
84 bool loadMetadata() {
return true; }
87 std::string private_key;
88 std::unique_ptr<MetaPack> current_meta;
89 std::unique_ptr<Uptane::MetaBundle> meta_bundle_;
94 #endif // PRIMARY_MANAGEDSECONDARY_H_