Skip to content

feat(signer): add direct COSE callback binding - #339

Open
s35-lee wants to merge 1 commit into
contentauth:mainfrom
s35-lee:feat/direct-cose-callback-binding
Open

s35-lee wants to merge 1 commit into
contentauth:mainfrom
s35-lee:feat/direct-cose-callback-binding

Conversation

@s35-lee

@s35-lee s35-lee commented Oct 11, 2026 •

Copy link
Copy Markdown

Changes in this pull request

Adds Signer.from_cose_callback(callback, reserve_size) for external signing services that receive serialized C2PA claim bytes and return a complete tagged COSE_Sign1 structure.

  • Registers the c2pa_signer_create_direct_cose native binding.
  • Validates reservation size, callback result type, and exact output length.
  • Reports callback exceptions and invalid results as native signing failures.
  • Retains the callback through signer lifetime and Context ownership transfer.
  • Frees the native signer if Python instance construction fails.
  • Adds direct-COSE tests to the existing test_unit_tests.py suite.

This PR has dependency on contentauth/c2pa-rs#2848

Before merging and releasing, c2pa-native-version.txt must reference a native release containing c2pa_signer_create_direct_cose. The current version pin remains unchanged; local validation used C2PA_LIBRARY_NAME to load the new library.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

Expose Signer.from_cose_callback through the native direct COSE API.

This branch has not been deployed

No deployments
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