A Rust CLI for validating C2PA media assets, standalone .c2pa manifests, and crJSON reports. It can also evaluate asset profiles against an asset's crJSON indicators. Structured output is JSON by default, with optional YAML, Markdown, or HTML summaries.
- Media assets — JPEG, PNG, PDF, MP4, and other formats that can contain or reference C2PA manifests
- Standalone manifests —
.c2pasidecar files (manifest structure and signatures only; no source asset) - crJSON reports — JSON files with
schema: "crjson"(structure and required fields)
default— Validate against the official C2PA Conformance Trust List onlyitl— Try official list first, then the Interim Trust List (ITL)custom— Use your own trust list (requires--trust-list FILE_OR_URL)
Custom trust lists can be a local path or URL to a PEM file. Use --settings to overlay c2pa-rs settings for advanced trust configuration.
- Formats:
--format json(default),yaml,markdown, orhtml - Output location:
-o/--outputfile or directory. If omitted, a single result is written next to the source (e.g.photo.jpg→photo.json); with multiple inputs and structured output (jsonoryaml), use-o <directory>to write one file per input - crJSON: JSON or YAML output uses Reader crJSON for assets unless
--profileis supplied - Profile evaluation:
--profile path/to/profile.ymlevaluates the profile against each asset's Reader crJSON and writes the profile report in the selected structured format
Validate one or more assets (default JSON to stdout or next to file):
cargo run --bin c2pa-validate -- image.jpg
cargo run --bin c2pa-validate -- --format json ./samples/*.jpgWrite to a specific file or directory:
cargo run --bin c2pa-validate -- -o report.json image.jpg
cargo run --bin c2pa-validate -- -o ./out --format json ./samples/*.jpgStandalone .c2pa manifest (no source asset):
cargo run --bin c2pa-validate -- manifest.c2paTrust list options:
cargo run --bin c2pa-validate -- --trust-mode itl image.jpg
cargo run --bin c2pa-validate -- --trust-mode custom --trust-list ./my-trust.pem image.jpgHuman-readable output and strict mode (warnings as failures):
cargo run --bin c2pa-validate -- --format markdown -o report.md image.jpg
cargo run --bin c2pa-validate -- --strict image.jpgProfile evaluation:
cargo run --bin c2pa-validate -- --profile ./testfiles/profiles/real-media_profile.yml image.jpg
cargo run --bin c2pa-validate -- --profile ./testfiles/profiles/real-life-capture_profile.yml --format yaml -o profile-report.yaml image.pngOverlay c2pa-rs settings from a file:
cargo run --bin c2pa-validate -- --settings settings.json image.jpgHelp and version:
cargo run --bin c2pa-validate -- --help
cargo run --bin c2pa-validate -- --version| Option | Description |
|---|---|
INPUT... |
Files or glob patterns to validate |
-o, --output FILE_OR_DIR |
Output file or directory |
-f, --format json|yaml|markdown|html |
Output format (default: json) |
--profile FILE |
Evaluate this YAML profile against each asset's crJSON indicators |
-t, --trust-mode default|itl|custom |
Trust list mode |
--trust-list FILE_OR_URL |
Trust list path/URL (required for custom) |
--settings FILE |
Overlay c2pa-rs settings (JSON/TOML) |
--strict |
Fail on warnings, not only invalid assets |
-v, --verbose |
Increase verbosity (repeat for debug) |
For build, workspace layout, and contributing, see CONTRIBUTING.md.