A minimal test setup for the C2PA C API (https://github.com/contentauth/c2pa-rs/blob/main/c2pa_c_ffi/src/c_api.rs), demonstrating image signing using memory streams.
This project provides a simple example of how to use the C2PA C API to sign images using memory streams. It is designed to run in a containerized environment and is meant to serve as a (hopefully) helpful example of how to integrate C2PA into plain C projects.
test-c2pa-ffi.c: Main test source codeDockerfile: Container build instructions for dependencies and test executionresources/: Example input files (images, manifests, certs, keys)
- Docker (for building and running)
- Build the Docker image:
docker build -t test-c2pa-ffi . - Run the container, the signed image will get copied out to
resources/:docker run -v "$PWD/resources":/workspace/tmp test-c2pa-ffi
- Output and error messages are printed to stdout for debugging.
- To test with other images, change the hardcoded filepaths in test-c2pa-ffi.c and rebuild. TODO: pass file paths as args.