1 #ifndef PRIMARY_MANAGEDSECONDARY_H_ 2 #define PRIMARY_MANAGEDSECONDARY_H_ 8 #include <boost/filesystem.hpp> 12 #include "primary/secondary_config.h" 13 #include "primary/secondaryinterface.h" 22 constexpr
static const char*
const Type =
"managed";
25 bool partial_verifying{
false};
26 std::string ecu_serial;
27 std::string ecu_hardware_id;
28 boost::filesystem::path full_client_dir;
29 std::string ecu_private_key;
30 std::string ecu_public_key;
31 boost::filesystem::path firmware_path;
32 boost::filesystem::path target_name_path;
33 boost::filesystem::path metadata_path;
34 KeyType key_type{KeyType::kRSA2048};
44 bool isConsistent()
const;
55 void init(std::shared_ptr<SecondaryProvider> secondary_provider_in)
override {
56 secondary_provider_ = std::move(secondary_provider_in);
61 if (!sconfig.ecu_serial.empty()) {
67 PublicKey getPublicKey()
const override {
return public_key_; }
69 int getRootVersion(
bool director)
const override;
77 bool loadKeys(std::string* pub_key, std::string* priv_key);
82 std::shared_ptr<SecondaryProvider> secondary_provider_;
84 std::string detected_attack;
87 void storeKeys(
const std::string& pub_key,
const std::string& priv_key);
91 bool storeMetadata() {
return true; }
92 bool loadMetadata() {
return true; }
95 std::string private_key;
97 Uptane::MetaBundle meta_bundle_;
102 #endif // PRIMARY_MANAGEDSECONDARY_H_