How contentauth/c2c2pa works
Project type and purpose
• This is a minimal hybrid-language “example” project demonstrating how to call a Rust-based C2PA SDK (c2pa-rs crate) from a C application.
• The README confirms it is not a full‐blown microservice or web app but a language‐binding proof‐of‐concept that uses Cargo, a Makefile, and a single C source file.
File structure
• Top‐level artifacts:
• Cargo.toml – defines the Rust crate (dependencies, build config)
• Makefile – orchestrates the build (cargo + gcc) and the run
• src/lib.rs – Rust library source (the SDK wrapper exposing C FFI)
• src/main.c – C application that calls into the Rust FFI
• rsc/es256_*.pem/key – resource files (certificates/keys used at runtime)
• No “frontend” or “backend” directories: this is a single executable comprised of two language components.
Key insights from the README
• Build and run with make run (Makefile invokes cargo build + gcc link).
• This is purely local, no network services or databases involved.
Elements
• Makefile → Cargo build → Rust library artifact
• Makefile → GCC compile/link → C executable
• C Executable → (FFI) → Rust Library
• Rust Library → loads → PEM/KEY files
• Another for runtime components (C Executable, Rust Library)
• A third for external resources (cert/key)