#pragma once #include #include #include #include "json.hpp" #include "time_helpers.h" namespace BareMinimumCrypto { using namespace std; using nlohmann::json; typedef vector Bytes; struct ExpiringSignature { // Payload is contained in here Bytes cert; Bytes sig; bool operator == (const ExpiringSignature & o) const; bool operator != (const ExpiringSignature & o) const; }; struct KeyCertFile { Bytes sig; // The rest of the fields are inside a nested msgpack that gets signed Bytes pubkey; TimeRange valid_time; Bytes to_msgpack () const; static optional try_from_msgpack (const json & msg); }; }