feat: Add ZIP support (+ EPUB, Office Open XML, Open Document, and OpenXPS) and Collection Data Hash assertion
Changes in this pull request
Adds ZIP support (and by extension EPUB, Office Open XML, Open Document, and OpenXPS support) and the corresponding Collection Data Hash assertion.
Related Issues
- Completes #487
- Completes #406
- Completes #349
Checklist
- [x] This PR represents a single feature, fix, or change.
- [x] All applicable changes have been documented.
- [x] Any
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.
Temporarily using forked repo until https://github.com/zip-rs/zip2/pull/232 is merged
CodSpeed Performance Report
Merging #499 will not alter performance
Comparing ok-nick/zip (950d3bd) with main (c33a84e)
Summary
✅ 16 untouched
⏩ 2 skipped[^skipped]
[^skipped]: 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.
Before this is merged we should double check:
Its general purpose bit flag and crc-32 fields shall be set to 0. The date and time fields may be set to the time of creation of the ZIP archive, or set to 0. It may have a file comment.
The zip crate abstracts this functionality, so it's hard to tell what is being set.
The C2PA spec states the CRC32 should be set to 0, yet the ZIP spec states:
4.1.5 Data integrity MUST be provided for each file using CRC32.
There's a chicken or the egg problem here where we can't compute the CRC32 unless the manifest is computed but we can't compute the hard binding hashes until the CRC32 is set. The spec may need to be modified here to exclude the CRC32 from the hash.