C2PA Pro
imgproxy can attach C2PA (Coalition for Content Provenance and Authenticity) manifests — also known as Content Credentials — to processed images. A C2PA manifest is a tamper-evident record embedded in the image that describes its provenance: who created or edited it, what software was used, and, when the source image already carries a manifest, the full edit history inherited from it.
When enabled, imgproxy signs every processed image it outputs with a C2PA manifest, using c2pa-rs under the hood.
You can find the list of formats supporting C2PA manifests in the c2pa-rs documentation.
imgproxy doesn't sign SVG images with C2PA manifests and removes any existing ones during minification. If you need C2PA signing for SVG images, please let us know.
Configuration
IMGPROXY_C2PA_ENABLED: whentrue, imgproxy will sign processed images with a C2PA manifest. Default:falseIMGPROXY_C2PA_SETTINGS: the raw c2pa-rs SDK settings string, including signing credentials, trust anchors, and verification/builder options. Takes precedence overIMGPROXY_C2PA_SETTINGS_PATHwhen both are setIMGPROXY_C2PA_SETTINGS_PATH: the path to a file containing the c2pa-rs SDK settings, as an alternative to providing them inline viaIMGPROXY_C2PA_SETTINGSIMGPROXY_C2PA_FORMAT: the format of the C2PA settings. Can betomlorjson. Default:tomlIMGPROXY_C2PA_ACTION: the C2PA action recorded in the manifest for processed images. Default:c2pa.editedIMGPROXY_C2PA_SOFTWARE_AGENT: the software agent name recorded in the manifest. Default:imgproxyIMGPROXY_C2PA_SOFTWARE_AGENT_VERSION: the software agent version recorded in the manifest. Default: the running imgproxy version
C2PA Settings
C2PA settings are used to configure the signing and verification behavior of imgproxy when working with C2PA manifests. The settings should be formatted as either TOML or JSON, depending on the value of IMGPROXY_C2PA_FORMAT. You can provide them either inline via IMGPROXY_C2PA_SETTINGS or through a file specified by IMGPROXY_C2PA_SETTINGS_PATH.
You need to provide at least the signing credentials ([signer.local] or [signer.remote] sections) for C2PA signing to work. Other options, such as trust anchors and verification settings, are optional but can be included as needed.
You can find the full list of supported C2PA settings in the c2pa-rs settings reference and the test settings example.
Settings example
This example uses a self-signed certificate/key pair suitable for testing purposes only (it's marked FOR TESTING_ONLY in its Subject). It lets you try C2PA signing end-to-end, but the manifests it produces won't validate against real trust anchors. Do not use this certificate/key pair in production environments.
To use this example in production, replace sign_cert and private_key with your own certificate/key pair obtained from a trusted certificate authority. See Getting a signing certificate for how to obtain one.
Here's a minimal IMGPROXY_C2PA_SETTINGS_PATH TOML file with just a local signer, enough to get C2PA signing working:
[signer.local]
alg = "es256"
sign_cert = """
-----BEGIN CERTIFICATE-----
MIIChzCCAi6gAwIBAgIUcCTmJHYF8dZfG0d1UdT6/LXtkeYwCgYIKoZIzj0EAwIw
gYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU29tZXdoZXJl
MScwJQYDVQQKDB5DMlBBIFRlc3QgSW50ZXJtZWRpYXRlIFJvb3QgQ0ExGTAXBgNV
BAsMEEZPUiBURVNUSU5HX09OTFkxGDAWBgNVBAMMD0ludGVybWVkaWF0ZSBDQTAe
Fw0yMjA2MTAxODQ2NDBaFw0zMDA4MjYxODQ2NDBaMIGAMQswCQYDVQQGEwJVUzEL
MAkGA1UECAwCQ0ExEjAQBgNVBAcMCVNvbWV3aGVyZTEfMB0GA1UECgwWQzJQQSBU
ZXN0IFNpZ25pbmcgQ2VydDEZMBcGA1UECwwQRk9SIFRFU1RJTkdfT05MWTEUMBIG
A1UEAwwLQzJQQSBTaWduZXIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQPaL6R
kAkYkKU4+IryBSYxJM3h77sFiMrbvbI8fG7w2Bbl9otNG/cch3DAw5rGAPV7NWky
l3QGuV/wt0MrAPDoo3gwdjAMBgNVHRMBAf8EAjAAMBYGA1UdJQEB/wQMMAoGCCsG
AQUFBwMEMA4GA1UdDwEB/wQEAwIGwDAdBgNVHQ4EFgQUFznP0y83joiNOCedQkxT
tAMyNcowHwYDVR0jBBgwFoAUDnyNcma/osnlAJTvtW6A4rYOL2swCgYIKoZIzj0E
AwIDRwAwRAIgOY/2szXjslg/MyJFZ2y7OH8giPYTsvS7UPRP9GI9NgICIDQPMKrE
LQUJEtipZ0TqvI/4mieoyRCeIiQty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Bbl9otNG/cch3DAw5rGAPV7NWkyl3QGuV/wt0MrAPDo
-----END PRIVATE KEY-----
"""
Point IMGPROXY_C2PA_SETTINGS_PATH at the file (or inline its contents via IMGPROXY_C2PA_SETTINGS) and set IMGPROXY_C2PA_ENABLED=true to start signing.
Provenance and creation info
Every signed image gets an action recorded using IMGPROXY_C2PA_ACTION (c2pa.edited by default), with the software agent taken from IMGPROXY_C2PA_SOFTWARE_AGENT/IMGPROXY_C2PA_SOFTWARE_AGENT_VERSION. This always applies and can't be overridden per request.
The source image is always included as an ingredient in the manifest, ensuring that its provenance chain is preserved.
Disabling C2PA signing
To disable C2PA signing per request, use the c2pa processing option:
.../c2pa:false/...
If you want to disable C2PA signing by default, you can add c2pa:false to your default preset.
Reading the manifest
You can read back the C2PA manifest of a source or already-signed image using the c2pa info option:
/info/.../c2pa:1/...
Read more about the c2pa info option, including the response format, in the Info options reference.