Concise Binary Object Representation (CBOR) Sequences
Extracted elements (15)
CBOR Sequences do not use a marker between items (unlike JSON Text Sequences), because CBOR-encoded data items are self-delimiting and the end can always be calculated from the encoding itself.
For applications requiring efficient element skipping or multi-threaded decoding fan-out, byte strings (which carry length information) containing embedded CBOR can be used as CBOR Sequence elements, enabling skip-without-decode and partial error recovery.
There is no end-of-sequence indicator in CBOR Sequences. If an end marker is needed, encoding the values as a single CBOR array (definite or indefinite length) is more appropriate.
CBOR Sequence format can reliably detect truncation of the last CBOR data item in the sequence, but cannot detect entirely missing CBOR data items at the end. A streaming decoder may pause and resume decoding when a truncated final item is being received.
If any data item in the sequence is not well formed, it is not possible to reliably decode the rest of the sequence. Handling malformed data is outside the scope of this specification.
In CDDL, CBOR Sequences are supported as byte string contents via the '.cborseq' control operator, but CDDL does not yet provide for unadorned CBOR Sequences as a top-level subject; the workaround is to use an array for the top-level rule with explanatory text.
Decoders MUST fail gracefully in the face of malicious inputs, since they must operate on input that is assumed to be untrusted.
Fragment identifier syntax and semantics for '+cbor-seq' media types SHOULD be the same as specified for 'application/cbor-seq'. For specific 'xxx/yyy+cbor-seq' types, if the fragment identifier resolves per '+cbor-seq' rules it SHOULD be processed as such; otherwise process per 'xxx/yyy+cbor-seq'.
The '+cbor-seq' structured syntax suffix SHOULD be used by a media type when the result of parsing its bytes as a CBOR Sequence is meaningful and is at least sometimes not just a single CBOR data item.
A CBOR Sequence is a sequence of bytes defined as either an empty (zero-length) sequence of bytes, or the concatenation of one or more encoded CBOR data items. Concatenating zero or more CBOR Sequences also results in a valid CBOR Sequence.
Decoding a CBOR Sequence proceeds by repeatedly decoding a single CBOR data item from the byte stream and collecting results; a streaming decoder delivers zero or more CBOR data model values as bytes become available.
IANA has assigned CoAP Content-Format ID 63 for the media type 'application/cbor-seq' in the 'CoAP Content-Formats' subregistry of the 'Constrained RESTful Environments (CoRE) Parameters' registry.
IANA has registered the '+cbor-seq' structured syntax suffix in the 'Structured Syntax Suffix Registry', with encoding considerations of binary and security considerations referencing RFC 8742 Section 5.
IANA has registered the media type 'application/cbor-seq' in the 'Media Types' registry. Type: application, Subtype: cbor-seq, encoding: binary, no required or optional parameters.
The security considerations of CBOR (RFC 7049) apply to CBOR Sequences. The format provides no cryptographic integrity protection of any kind, but can be combined with CBOR Object Signing and Encryption (COSE) to do so. COSE protections can be applied to an entire sequence or to each element independently.