CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
GpgCertPayload.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <cstddef>
7#include <cstdint>
8
9namespace cdc::mod_gpg {
10
24
26constexpr size_t kGpgCertPayloadMin = 20 + 20 + 1 + 2 + 1;
28constexpr size_t kGpgCertPayloadMax = 20 + 20 + 1 + 63 + 2 + kGpgSelfCertSigMax;
29
42size_t gpgBuildCertPayload(const gpg_recv_key_t& signed_key,
43 uint8_t* out, size_t out_size);
44
54bool gpgParseCertPayload(const uint8_t* data, size_t len,
55 gpg_self_cert_t* out, uint8_t out_target_fp[20]);
56
57} // namespace cdc::mod_gpg
constexpr size_t kGpgCertPayloadMax
Maximum payload size (maximum issuer uid + maximum signature packet).
constexpr size_t kGpgSelfCertSigMax
Maximum length of a stored certification signature packet body (Tag 2).
bool gpgParseCertPayload(const uint8_t *data, size_t len, gpg_self_cert_t *out, uint8_t out_target_fp[20])
Parse a certification return message into a self-cert record.
constexpr size_t kGpgCertPayloadMin
Minimum payload size (empty issuer uid, 1-byte signature packet).
size_t gpgBuildCertPayload(const gpg_recv_key_t &signed_key, uint8_t *out, size_t out_size)
Serialise a certification return message for a cross-signed key.
One GPG public key received from another badge.
One third-party certification received over the badge's own key.