feat: expose Builder.signDataHashedEmbeddable#66
Open
deblanco wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose
Builder.sign_data_hashed_embeddable(and its async/CallbackSigner variant) from the underlyingc2pacrate 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.c2pafiles and remote-manifest URLs — without forcing callers to round-trip the asset through the Builder.With
alg: "sha256"andexclusions: [], the resulting manifest'sc2pa.hash.data.hashequalsSHA-256(asset), so a verifier holding the original file can recompute the digest and validate the manifest.Motivation
c2pa-rsalready supports this signing mode, but the Node binding only exposed the asset-in / asset-outsignpath. Use cases that need it: