← demo catalog · docs

@projektemacher/tify-plugin-c2pa

Note: This code was generated with AI assistance — opencode, powered by GLM (Z.ai).

C2PA provenance panel for the TIFY IIIF viewer: checks the tiles in the current viewport for embedded C2PA manifests and validates them against configurable trust anchors. The dock button carries the validity tint.

import { c2paPlugin } from '@projektemacher/tify-plugin-c2pa';
import '@projektemacher/tify-plugin-core/style.css';

const plugin = await c2paPlugin(tify, {
  panelEl: document.querySelector('#panel'),
  trustAnchors: { url: 'https://contentcredentials.org/trust/anchors.pem' },
});

Notes

Example

example/ — per-tile provenance for the live viewport with a trust-anchor form inside the panel. Run npm run dev at the repo root and open /packages/plugin-c2pa/example/.

Manifest generation

Generate C2PA-signed image services with fliiifenleger: the --sink c2pa sink signs every tile and advertises the https://christianmahnke.de/iiif/c2pa/ service entry. Use --iiif-version V3 — and pass --sink-opt trust-anchor=<url> to advertise the trustAnchor URI that this plugin's trustAnchors option validates against (requires Image API 3; generation fails with V2):

java -jar cli/target/fliiifenleger-cli.jar generate \
  --iiif-version V3 \
  --sink c2pa \
  --sink-opt cert-name=fliiifenleger \
  --sink-opt trust-anchor=https://example.com/anchors.pem \
  -o ./signed-iiif /path/to/image.jpg

Development

npm run build       # dist/ (ESM + declarations)
npm run typecheck
npm run test:i18n   # catalogue coverage for src/ + example/
npm run lint

License: AGPL-3.0-or-later.