Signing with local credentials
Overview
To sign a claim in a C2PA manifest you need an end-entity certificate that complies with the C2PA trust model. Then you can use your private key with the certificate to sign it.
Trust lists connect the end-entity certificate that signed a manifest back to the originating root CA. This is accomplished by supplying the subordinate public X.509 certificates forming the trust chain (the public X.509 certificate chain). If those are not supplied, you can use a private credential store to validate the certificate trust chain. If you do not supply a certificate chain or trust list, validators may reject the manifest. See the C2PA specification for more details.
Signing a manifest
The simplest way to add a C2PA manifest to an asset file and sign it is by using C2PA Tool (c2patool). You can run C2PA Tool manually from the command line (for example, during development) and more generally from any executable program that can call out to the shell.
Similarly, using the Rust SDK, you can add a manifest to an asset file, referencing the certificate and private key file. The Node.js, Python, and C++/C libraries can also add and sign a manifest.
Accessing a private key and certificate directly from the file system is fine during development, but doing so in production is not secure. Instead use a Key Management Service (KMS) or a hardware security module (HSM) to access the certificate and key; For more information, see Using a certificate in production.