Skip to main content

Module cose

Module cose 

Source
Expand description

COSE encoding of trusted artifacts (SIGNATIF §8, the /conf/format-cose profile’s co-signature encoding obligation).

A TrustedArtifact serializes into a chain of confium_composite::cose::CoseSign1 structures — one per co-signature block — followed by one carrying the artifact body (id, payload, canonical hash) as its payload. Each co-signature COSE structure signs over the artifact’s canonical payload hash, and the chain round-trips losslessly through encode_artifact_cose/decode_artifact_cose. The CBOR deterministic-encoding characteristics of the profile (definite lengths, minimum-length integers) come from the composite crate’s encoder.

Functions§

decode_artifact_cose
Decode a COSE chain back into a trusted artifact. The final structure is the body; every preceding structure is a co-signature block. The canonical payload hash is cross-checked against the payload (self-description integrity).
encode_artifact_cose
Encode a trusted artifact as a COSE chain: one COSE_Sign1 per co-signature (signing over the canonical payload hash), then a body structure carrying the self-description.