Skip to content

Conversation

nodh
Copy link
Contributor

@nodh nodh commented Jul 19, 2023

Adds the feature of using serial labels, i.e. numbers, as CBOR map keys instead of the usual strings as serial labels. This is probably useful for supporting COSE structures, or anything related like COSE keys, where numbers are used extensively as map keys.

We could also apply it on top of #2359.

@JesusMcCloud
Copy link
Contributor

Superseded by #2412. please close this one.

@nodh nodh closed this Aug 21, 2023
sandwwraith added a commit that referenced this pull request Jul 22, 2024
This PR contains all features required to serialize and parse COSE-compliant CBOR (thanks to @nodh). While some canonicalization steps (such as sorting keys) still need to be performed manually. It does get the job done quite well. Namely, we have successfully used the features introduced here to create and validate ISO/IEC 18013-5:2021-compliant mobile driving license data.

This PR introduces the following features to the CBOR format:

- Serial Labels
- Tagging of keys and values
- Definite length encoding (this is the largest change, as it effectively makes the cbor encoder two-pass)
- Option to globally prefer major type 2 for byte array encoding
- Various QoL changes, such as public CborEncoder/CborDecoder interfaces and separate CborConfiguration class.

This PR obsoletes #2371 and #2359 as it contains the features of both PRs and many more.

Fixes #1955
Fixes #1560

Co-authored-by: Christian Kollmann <christian.kollmann@a-sit.at>
Co-authored-by: Leonid Startsev <sandwwraith@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants