Skip to content

Conversation

@setrofim
Copy link
Collaborator

This implements the last part of human-readable serialization plus some other fixes and minor enhancements.

This is implmented on top of #35

Implement serialization for ConciseTlTag that uses string field names
for human-readable formats, and integer keys otherwise.

Also, add a Builder to simplify construction of valid ConciseTlTag's.

Signed-off-by: setrofim <[email protected]>
- Remove derived From implementations from OneOrMore and implement
  them by hand. This is necessary to handle coversions from
  single-element Vec's correctly (must converted to One, not More).
- Implement is_one() and to_vec() convenience methods for OneOrMore.
- Implement INtoIterator for OneOrMore.
- Implement Serialization for AttributeValue that uses string field
  names for human-readable formats and integer keys otherwise.
- Add a number of convenience methods (mostly propagated from
  OneOrMore) and conversions for AttributeValue.

Signed-off-by: setrofim <[email protected]>
- Add TryFrom<String> conversion for fixed bytes, that, analogously with
  the Bytes implementation, expects base64-encoded data.
- Add From<FixedBytes> conversion for Bytes.

Signed-off-by: setrofim <[email protected]>
Implement serialization for CoSWID structures that uses string field
names for human-readable formats and integer keys otherwise[*].

To support this, a number of changes have been made to core structures:

- Remove HashEntry, using Digest in its place
- Add additional conversion for ExtenstionValue from  native Rust types.
- Implement Role enum, and ermove generic Role from core that is no
  longer used.
- Implement human-readable serialization for TextOrBytesSized.
- Add From<i128> conversion for Label.
- Implement Add and Display for OneOreMore.
- Implement AttributeMap for global attributes (these can appear
  alongside extensions in CoSWID structures).
- Fix VersionScheme::Semver serialization value.

[*]: Unlike other CoRIM structures, CoSWID structures may contain string
entries for global attributes in non-human-readable encodings.

Signed-off-by: setrofim <[email protected]>
@setrofim setrofim merged commit 007b52d into master Aug 6, 2025
2 checks passed
@setrofim setrofim deleted the coswid branch August 6, 2025 13:27
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.

1 participant