Skip to content

feat: expose Builder.signDataHashedEmbeddable#66

Open
deblanco wants to merge 2 commits into
contentauth:mainfrom
stabilityprotocol:feat/sign-data-hashed-embeddable
Open

feat: expose Builder.signDataHashedEmbeddable#66
deblanco wants to merge 2 commits into
contentauth:mainfrom
stabilityprotocol:feat/sign-data-hashed-embeddable

Conversation

@deblanco
Copy link
Copy Markdown

@deblanco deblanco commented May 9, 2026

Summary

Expose Builder.sign_data_hashed_embeddable (and its async/CallbackSigner variant) from the underlying c2pa crate to the Node.js API. This enables sign-time flows where the asset bytes are not available but a pre-computed hash is — i.e. sidecar .c2pa files and remote-manifest URLs — without forcing callers to round-trip the asset through the Builder.

With alg: "sha256" and exclusions: [], the resulting manifest's c2pa.hash.data.hash equals SHA-256(asset), so a verifier holding the original file can recompute the digest and validate the manifest.

Motivation

c2pa-rs already supports this signing mode, but the Node binding only exposed the asset-in / asset-out sign path. Use cases that need it:

  • Sidecar signing — sign once, ship asset.jpg and asset.jpg.c2pa separately.
  • Remote manifest — sign once, host the manifest at a URL referenced by a future embedded c2pa.remote_manifest.
  • Hash-only inputs — pipelines where only the digest is available at sign time (e.g. asset stored elsewhere, only metadata + hash crosses a boundary).

deblanco added 2 commits May 9, 2026 17:48
Adds Neon bindings + TS wrappers for c2pa-rs
`Builder::sign_data_hashed_embeddable` (sync) and its async variant.
Produces a signed embeddable manifest from a pre-computed `DataHash`,
without needing the asset bytes at sign time. Targets sidecar `.c2pa`
and remote-manifest workflows.

The binding calls `data_hashed_placeholder` internally before signing
(required by upstream to reserve the DataHash assertion slot); the
placeholder bytes are discarded since callers in this flow do not
embed them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant