|
|
|
@ -12,4 +12,26 @@ namespace BareMinimumCrypto {
|
|
|
|
|
bool ExpiringSignature::operator != (const ExpiringSignature & o) const {
|
|
|
|
|
return ! (*this == o);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bytes KeyCertFile::to_msgpack () const {
|
|
|
|
|
const json cert_j {
|
|
|
|
|
{"pubkey", json::binary (pubkey)},
|
|
|
|
|
{"not_before", valid_time.not_before},
|
|
|
|
|
{"not_after", valid_time.not_after},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const auto cert = json::to_msgpack (cert_j);
|
|
|
|
|
|
|
|
|
|
const json j {
|
|
|
|
|
{"sig", json::binary (sig)},
|
|
|
|
|
{"cert", json::binary (cert)},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return json::to_msgpack (j);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
optional <KeyCertFile> KeyCertFile::try_from_msgpack (const json & msg)
|
|
|
|
|
{
|
|
|
|
|
return nullopt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|