Expand description
The c2pa-manifest link relation, parsed and serialised per {RFC 8288}.
When an asset is retrieved over HTTP, a validator should look for a Link
header carrying rel="c2pa-manifest"; its target is where the C2PA Manifest
Store can be retrieved. The target may also name a Manifest Store already
embedded in the asset, through a JUMBF URI fragment.
This module is dependency-free and operates on &str, so it works under any
HTTP stack. The Tower integration lives in crate::layer.
§Grammar
Link = #link-value
link-value = "<" URI-Reference ">" *( OWS ";" OWS link-param )
link-param = token BWS "=" BWS ( token / quoted-string )Commas separate link-values and semicolons separate parameters, but both may
appear inside a <target> or a quoted string — a query string with ?a=1,2
is entirely legal. Splitting naively on those characters is the classic way
to mis-parse this header, so the scanner here tracks both contexts.
Structs§
- Manifest
Link - A located
c2pa-manifestlink.
Constants§
- REL
- The IANA-registered link relation naming a C2PA Manifest Store.
Functions§
- encode_
target - Percent-encode the bytes that cannot appear literally in a URI reference.
- extract
- The single
c2pa-manifestlink advertised by a response. - format
- Build a
Linkheader value advertisingurias the C2PA Manifest Store. - format_
strict - As [
format], but fails rather than repairing a target that is not already a valid URI reference. - locate_
all - Every
c2pa-manifestlink across the givenLinkheader values, in order.