Skip to main content

Module link

Module link 

Source
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§

ManifestLink
A located c2pa-manifest link.

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-manifest link advertised by a response.
format
Build a Link header value advertising uri as 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-manifest link across the given Link header values, in order.