Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.

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

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

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.

scouten-adobe added a commit to contentauth/c2pa-js that referenced this pull request Jun 19, 2026
Replays contentauth/c2pa-node-v2#69 into packages/c2pa-node, now that
c2pa-node-v2 has been migrated into this monorepo.

The c2pa-raw-crypto split (c2pa-rs#2231) 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, so a caller-supplied raw signer is no longer needed.

- Remove the AsyncRawSigner / RawSigner impls and async_raw_signer() /
  as_raw_signer() hooks from NeonCallbackSigner and
  NeonIdentityAssertionSigner, keeping their complete AsyncSigner impls.
- Rewrite NeonIdentityAssertionSigner::certs() to use AsyncSigner::certs()
  instead of the removed raw cert_chain().
- Refresh stale Send/Sync doc comments that referenced AsyncRawSigner
  (including neon_credential_holder.rs).
- Re-pin the c2pa git-branch dependency in Cargo.lock to the updated
  split branch HEAD (0.88.0).

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@scouten-adobe

scouten-adobe commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

I've updated contentauth/c2pa-js#130 to contain what was in this PR. Closing.

@scouten-adobe
scouten-adobe deleted the update-c2pa-rs-raw-crypto-split branch June 19, 2026 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants