Skip to content

feat: update to c2pa-rs with c2pa-raw-crypto split#69

Open
scouten-adobe wants to merge 1 commit into
mainfrom
update-c2pa-rs-raw-crypto-split
Open

feat: update to c2pa-rs with c2pa-raw-crypto split#69
scouten-adobe wants to merge 1 commit into
mainfrom
update-c2pa-rs-raw-crypto-split

Conversation

@scouten-adobe

Copy link
Copy Markdown
Contributor

Summary

Updates the c2pa dependency to the contentauth/c2pa-rs#2231 branch (split-out-c2pa-raw-crypto-take-2), which splits c2pa-raw-crypto into its own crate.

Draft / blocked on upstream: the dependency points at the in-progress c2pa-rs branch by branch = ... rather than a released version. This should not merge until c2pa-rs#2231 lands and a corresponding c2pa release is available, at which point the dep should switch back to a version = "..." from crates.io.

Breaking changes addressed

The c2pa-raw-crypto split removes:

  • the c2pa::crypto::raw_signature module (AsyncRawSigner, RawSigner, RawSignerError), and
  • the AsyncSigner::async_raw_signer() hook.

The SDK now adapts any public AsyncSigner into its internal COSE signing layer directly (via AsyncSignerWrapper → the pub(crate) AsyncCoseSigner), so a caller-supplied raw signer is no longer needed.

Accordingly this PR:

  • removes the now-redundant AsyncRawSigner / RawSigner impls and the async_raw_signer() overrides from both NeonCallbackSigner and NeonIdentityAssertionSigner, keeping only their complete public AsyncSigner impls;
  • rewrites NeonIdentityAssertionSigner::certs() to use AsyncSigner::certs() instead of the removed raw cert_chain();
  • refreshes the stale Send/Sync doc comments that referenced AsyncRawSigner.

No behavior change: the async JS signing callback path is preserved, now driven through AsyncSigner::sign.

Testing

  • cargo build
  • cargo clippy ✓ (no warnings)
  • pnpm test: 59 passed, 10 skipped. All signing paths pass, including CallbackSigner > should create valid COSE signature with buffer output and the IdentityAssertion test. (The Trustmark suite is skipped/times out on model download — unrelated to this change.)

🤖 Generated with Claude Code

Point the c2pa dependency at the contentauth/c2pa-rs
`split-out-c2pa-raw-crypto-take-2` branch (PR #2231), which splits
c2pa-raw-crypto into its own crate.

The split removes the `c2pa::crypto::raw_signature` module and the
`AsyncSigner::async_raw_signer()` hook. The SDK now adapts any public
`AsyncSigner` into its internal COSE signing layer directly, so the
caller-supplied raw signer is no longer needed.

Remove the now-redundant `AsyncRawSigner`/`RawSigner` impls and the
`async_raw_signer()` overrides from both `NeonCallbackSigner` and
`NeonIdentityAssertionSigner`, keeping only their complete public
`AsyncSigner` impls. Rewrite `NeonIdentityAssertionSigner::certs()` to
use `AsyncSigner::certs()` instead of the removed raw `cert_chain()`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread Cargo.toml
async-trait = "0.1.77"
ciborium = "0.2.2"
c2pa = { version = "0.82.1", default-features = false, features = ["file_io", "pdf", "fetch_remote_manifests", "add_thumbnails", "rust_native_crypto", "default_http"] }
c2pa = { git = "https://github.com/contentauth/c2pa-rs.git", branch = "split-out-c2pa-raw-crypto-take-2", default-features = false, features = ["file_io", "pdf", "fetch_remote_manifests", "add_thumbnails", "rust_native_crypto", "default_http"] }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO NOT MERGE until this can reverted to a normal version reference. That can only happen after contentauth/c2pa-rs#2231 is merged and there is a corresponding release that we can point to here.

This syntax is used as part of the preflight of that PR.

@cdmurph32

Copy link
Copy Markdown
Collaborator

LGTM, but this repo is going to be archived once contentauth/c2pa-js#125 is merged.

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.

2 participants