cose namespace
Classes
- struct CoseSign1View
- Borrowed view of one decoded COSE_Sign1 message.
- struct PacketRfAuthHeadersView
- Optional PacketRF auth metadata carried in protected COSE headers.
Functions
- auto cose_sign1_decode_view(std::span<const uint8_t> bytes, CoseSign1View* out_view) -> bool
- Encodes minimal COSE_Sign1 directly into caller buffer.
- auto cose_sign1_encode_into(const std::span<const uint8_t> payload, const std::span<const uint8_t> key_id, const bool has_content_format, const uint16_t content_format, const Ed25519Signature& signature, const std::span<uint8_t> out_buffer, const PacketRfAuthHeadersView auth_headers, std::span<const uint8_t>*const out_bytes) -> bool
- Encodes minimal COSE_Sign1 directly into caller buffer with PacketRF auth headers.
- auto cose_sign1_sign_into(const IKeyService& key_service, std::span<uint8_t> tx_buffer, std::span<const uint8_t> payload, bool has_content_format, uint16_t content_format, std::span<uint8_t> scratch, PacketRfAuthHeadersView auth_headers, std::span<const uint8_t>* out_bytes) -> bool
- Signs one payload with device identity key and wraps it directly into caller TX buffer.
- auto cose_sign1_tbs_into(std::span<const uint8_t> protected_headers, std::span<const uint8_t> payload, std::span<uint8_t> scratch, std::span<const uint8_t>* out_bytes) -> bool
- Builds COSE Sig_structure bytes for COSE_Sign1 into caller scratch.
- auto cose_sign1_verify_view(std::span<const uint8_t> bytes, const IKeyService* key_service, std::span<uint8_t> scratch, CoseSign1View* out_view, bool* out_verified) -> bool
- Verifies one COSE_Sign1 message against trusted keys using caller scratch for TBS.
- auto cose_sign1_verify_with_public_key_view(const std::span<const uint8_t> bytes, const Ed25519PublicKey& public_key, const std::span<uint8_t> scratch, CoseSign1View*const out_view, bool*const out_verified) -> bool
- Verifies one COSE_Sign1 message against an explicit public key.
Variables
- int64_t kCoseAlgEdDSA constexpr
- uint16_t kCoseSign1ContentFormat constexpr
- uint64_t kPacketRfHeaderBootstrapCode constexpr
- uint64_t kPacketRfHeaderBootstrapKey constexpr
- uint64_t kPacketRfHeaderNonce constexpr
- size_t kPacketRfNonceSize constexpr
Function documentation
bool prf:: cose:: cose_sign1_decode_view(std::span<const uint8_t> bytes,
CoseSign1View* out_view)
#include <cose/cose.hpp>
Encodes minimal COSE_Sign1 directly into caller buffer.
On success, out_bytes points into out_buffer. Decodes PacketRF COSE_Sign1 profile used by firmware.
Supported protected headers are limited to alg, kid, and optional content-format. Duplicate labels, unknown protected labels, non-empty unprotected maps, and nil payloads are rejected.
bool prf:: cose:: cose_sign1_encode_into(const std::span<const uint8_t> payload,
const std::span<const uint8_t> key_id,
const bool has_content_format,
const uint16_t content_format,
const Ed25519Signature& signature,
const std::span<uint8_t> out_buffer,
const PacketRfAuthHeadersView auth_headers,
std::span<const uint8_t>*const out_bytes)
#include <cose/cose.hpp>
Encodes minimal COSE_Sign1 directly into caller buffer with PacketRF auth headers.
bool prf:: cose:: cose_sign1_sign_into(const IKeyService& key_service,
std::span<uint8_t> tx_buffer,
std::span<const uint8_t> payload,
bool has_content_format,
uint16_t content_format,
std::span<uint8_t> scratch,
PacketRfAuthHeadersView auth_headers,
std::span<const uint8_t>* out_bytes)
#include <cose/cose.hpp>
Signs one payload with device identity key and wraps it directly into caller TX buffer.
Supports in-place signing when payload already resides in tx_buffer.
bool prf:: cose:: cose_sign1_tbs_into(std::span<const uint8_t> protected_headers,
std::span<const uint8_t> payload,
std::span<uint8_t> scratch,
std::span<const uint8_t>* out_bytes)
#include <cose/cose.hpp>
Builds COSE Sig_structure bytes for COSE_Sign1 into caller scratch.
On success, out_bytes points into scratch.
bool prf:: cose:: cose_sign1_verify_view(std::span<const uint8_t> bytes,
const IKeyService* key_service,
std::span<uint8_t> scratch,
CoseSign1View* out_view,
bool* out_verified)
#include <cose/cose.hpp>
Verifies one COSE_Sign1 message against trusted keys using caller scratch for TBS.
Decoding still succeeds with out_verified=false when key_service is null or key is unknown; malformed COSE returns false.
bool prf:: cose:: cose_sign1_verify_with_public_key_view(const std::span<const uint8_t> bytes,
const Ed25519PublicKey& public_key,
const std::span<uint8_t> scratch,
CoseSign1View*const out_view,
bool*const out_verified)
#include <cose/cose.hpp>
Verifies one COSE_Sign1 message against an explicit public key.
Variable documentation
int64_t prf:: cose:: kCoseAlgEdDSA constexpr
#include <cose/cose.hpp>
uint16_t prf:: cose:: kCoseSign1ContentFormat constexpr
#include <cose/cose.hpp>
uint64_t prf:: cose:: kPacketRfHeaderBootstrapCode constexpr
#include <cose/cose.hpp>
uint64_t prf:: cose:: kPacketRfHeaderBootstrapKey constexpr
#include <cose/cose.hpp>
uint64_t prf:: cose:: kPacketRfHeaderNonce constexpr
#include <cose/cose.hpp>
size_t prf:: cose:: kPacketRfNonceSize constexpr
#include <cose/cose.hpp>