6 #include <boost/filesystem.hpp> 12 kFirstKnown = kED25519,
16 kLastKnown = kRSA4096,
20 inline std::ostream& operator<<(std::ostream& os,
const KeyType kt) {
23 case KeyType::kRSA2048:
26 case KeyType::kRSA3072:
29 case KeyType::kRSA4096:
32 case KeyType::kED25519:
39 os <<
'"' << kt_str <<
'"';
43 inline std::istream& operator>>(std::istream& is, KeyType& kt) {
48 if (kt_str ==
"\"RSA2048\"") {
49 kt = KeyType::kRSA2048;
50 }
else if (kt_str ==
"\"RSA3072\"") {
51 kt = KeyType::kRSA3072;
52 }
else if (kt_str ==
"\"RSA4096\"") {
53 kt = KeyType::kRSA4096;
54 }
else if (kt_str ==
"\"ED25519\"") {
55 kt = KeyType::kED25519;
57 kt = KeyType::kUnknown;
89 RunningMode RunningModeFromString(
const std::string& mode);
90 std::string StringFromRunningMode(
RunningMode mode);
92 enum class CryptoSource { kFile = 0, kPkcs11 };
94 inline std::ostream& operator<<(std::ostream& os, CryptoSource cs) {
97 case CryptoSource::kFile:
100 case CryptoSource::kPkcs11:
107 os <<
'"' << cs_str <<
'"';
118 bool IsExpiredAt(
const TimeStamp& now)
const;
119 bool IsValid()
const;
120 std::string ToString()
const {
return time_; }
121 bool operator<(
const TimeStamp& other)
const;
122 bool operator>(
const TimeStamp& other)
const;
123 friend std::ostream& operator<<(std::ostream& os,
const TimeStamp& t);
124 bool operator==(
const TimeStamp& rhs)
const {
return time_ == rhs.time_; }
136 std::ostream& operator<<(std::ostream& os,
const TimeStamp& t);
141 using UpdateRequestId = std::string;
145 Json::Value toJson();
146 static Package fromJson(
const std::string& );
195 typedef std::pair<UpdateResultCode, std::string> InstallOutcome;
203 std::string result_text;
204 Json::Value toJson()
const;
205 bool isSuccess()
const {
208 InstallOutcome toOutcome()
const;
210 static OperationResult fromOutcome(
const std::string&
id,
const InstallOutcome& outcome);
Partition creation failed.
Package installation failed.
Only accept an existing campaign.
Download any available updates and then shut down.
TimeStamp()
An invalid TimeStamp.
Only reject an existing campaign.
Dependency failure during package install, upgrade, or removal.
SWM Internal integrity error.
RunningMode
Execution mode to run aktualizr in.
Software package not found.
The module loader could not flash its managed module.
Only check for an existing campaign related to the device.
Updating process in progress.
UpdateResultCode
Result of an update.
Partition deletion failed.
User declined the update.
Software was blacklisted.
Tried to downgrade to older version.
Operation has already been processed.
Completely manual operation.
Partition patching failed.
Update image integrity has been compromised.
Operation executed successfully.
Install any available updates and then shut down.