Expand description
C2PA manifest embedding and hard binding for WebVTT subtitle and caption files.
WebVTT is a structured text format, so a C2PA Manifest Store is associated
with it using the fixed ASCII armour delimiters
(-----BEGIN C2PA MANIFEST----- / -----END C2PA MANIFEST-----) inside a
single-line NOTE comment placed immediately after the WEBVTT signature,
as specified by the C2PA structured text embedding section. Placement after
the signature (rather than at the start of the file) is what makes this
WebVTT-specific: the WEBVTT line is a reserved header that must come first.
WEBVTT
NOTE -----BEGIN C2PA MANIFEST----- https://example.com/m.c2pa -----END C2PA MANIFEST-----
00:00:00.000 --> 00:00:05.000
Hello world§Scope relative to c2pa-structured-text
c2pa-structured-text implements the general structured text embedding
method and lists WebVTT as one comment style. This crate is the canonical
WebVTT implementation: the general method’s “prepend a comment line” rule
would place the block before the WEBVTT signature and produce an invalid
file, and the hard binding needs WebVTT-aware placement. c2pa-structured-text
documents the WebVTT delimiter but defers correct placement and hard binding
here.
§Hard binding
See binding for the byte-exact c2pa.hash.data data hash and the single
exclusion range covering the manifest block.
§Validation
See bridge for extracting the manifest store and delegating
signature/trust/assertion validation to the official C2PA SDK.
§Features
hash(default):sha2-backedbinding::compute_data_hash/binding::verify_data_hash. Disable withdefault-features = falsefor a zero-dependency embed/extract build.c2pa(off by default): the [bridge::validate] delegation to c2pa-rs.
Re-exports§
pub use binding::data_hash_exclusion;pub use binding::Exclusion;pub use binding::HashAlg;pub use bridge::extract_manifest_source;pub use bridge::ManifestSource;pub use binding::compute_data_hash;pub use binding::verify_data_hash;
Modules§
- binding
- Hard binding for WebVTT: the
c2pa.hash.datadata hash. - bridge
- Validation bridge to the official C2PA SDK (c2pa-rs).
Structs§
- Extraction
Result - A located manifest
NOTEblock.
Enums§
- Error
- Errors returned when embedding, extracting, or hard-binding a manifest.
- Manifest
Ref - A manifest to associate with a WebVTT file.
Functions§
- embed_
manifest - Embed a manifest reference as a single-line
NOTEblock placed immediately after theWEBVTTsignature line, separated from adjacent blocks by blank lines as WebVTT requires. - extract_
manifest - Locate the C2PA manifest
NOTEblock in a WebVTT file. - remove_
manifest - Remove the manifest
NOTEblock from a WebVTT file, returning the file with that block’s byte range spliced out.