Skip to main content

Configuring settings

You can configure SDK settings using a JSON file that controls many aspects of the library's behavior. This definition works the same in all programming languages and platforms.

This document describes the complete JSON schema and available options.

NOTE: If you don't specify a value for a property, then the SDK will use the default value. If you specify a value of null, then the property will be set to null, not the default.

Overview

The configuration JSON has the following top-level structure:

{
"version": 1,
"trust": { ... },
"cawg_trust": { ... },
"core": { ... },
"verify": { ... },
"builder": { ... },
"signer": { ... },
"cawg_x509_signer": { ... }
}

Specifying settings file

To specify the settings file use Settings::from_string and specify the format as "json". For example:

Settings::from_string(include_str!("fixtures/test_settings.json"), "json")?;

Complete default configuration

Here's the JSON with all default values:

{
"version": 1,
"trust": {
"user_anchors": null,
"trust_anchors": null,
"trust_config": null,
"allowed_list": null
},
"cawg_trust": {
"verify_trust_list": true,
"user_anchors": null,
"trust_anchors": null,
"trust_config": null,
"allowed_list": null
},
"core": {
"merkle_tree_chunk_size_in_kb": null,
"merkle_tree_max_proofs": 5,
"backing_store_memory_threshold_in_mb": 512,
"decode_identity_assertions": true
},
"verify": {
"verify_after_reading": true,
"verify_after_sign": true,
"verify_trust": true,
"verify_timestamp_trust": true,
"ocsp_fetch": false,
"remote_manifest_fetch": true,
"skip_ingredient_conflict_resolution": false,
"strict_v1_validation": false
},
"builder": {
"claim_generator_info": null,
"thumbnail": {
"enabled": true,
"ignore_errors": true,
"long_edge": 1024,
"format": null,
"prefer_smallest_format": true,
"quality": "medium"
},
"actions": {
"all_actions_included": null,
"templates": null,
"actions": null,
"auto_created_action": {
"enabled": true,
"source_type": "empty"
},
"auto_opened_action": {
"enabled": true,
"source_type": null
},
"auto_placed_action": {
"enabled": true,
"source_type": null
}
},
"certificate_status_fetch": null,
"certificate_status_should_override": null,
"intent": null,
"created_assertion_labels": null,
"generate_c2pa_archive": null
},
"signer": null,
"cawg_x509_signer": null
}

Property reference

The top-level version property is a number specifying the settings format version. The only supported value currently is 1. All other properties are optional.

NOTES:

  • If you do not specify a value, the SDK will use the default value, if any.
  • If you specify a value of null, then the property will be set to null, not the default.
  • Do not quote Boolean property values (for example, use true not "true").

builder

The builder object specifies settings for the Builder API.

PropertyTypeDescriptionDefault value
builder.claim_generator_infoObjectDefault claim generator information. Used if the Builder hasn't specified one.
See below.
N/A
builder.certificate_status_fetchStringCertificate status fetching scopenull
builder.certificate_status_should_overrideBooleanOverride OCSP with certificate status assertionsnull
builder.intentobjectDefault builder intent. The value uses object notation and must be one of: {"Create": "digitalCapture"}
{"Create": "Edit"}
{"Create": "Update"}.
null
builder.created_assertion_labelsArrayArray of base assertion labels you want to treated as created. When the builder encounters one of these, it will become a created assertion.null
builder.generate_c2pa_archiveBooleanGenerate C2PA archive formatnull
builder.actionsObjectAction assertion configuration.
builder.actions.all_actions_includedBooleanWhether all actions are specifiednull
builder.actions.templatesArrayAction templatesnull
builder.actions.actionsArrayPredefined actions to addnull
builder.actions.auto_created_action.enabledBooleanEnable automatic c2pa.created actionstrue
builder.actions.auto_created_action.source_typeStringDigital source type for created action"empty"
builder.actions.auto_opened_action.enabledBooleanEnable automatic c2pa.opened actionstrue
builder.actions.auto_opened_action.source_typeStringDigital source type for opened actionnull
builder.actions.auto_placed_action.enabledBooleanEnable automatic c2pa.placed actionstrue
builder.actions.auto_placed_action.source_typeStringDigital source type for placed actionnull
builder.thumbnailObjectAutomatic thumbnail generation settings.
builder.thumbnail.enabledBooleanEnable automatic thumbnailstrue
builder.thumbnail.ignore_errorsBooleanContinue on thumbnail generation errorstrue
builder.thumbnail.long_edgeNumberSize of thumbnail's longest edge in pixels1024
builder.thumbnail.formatStringOutput format. One of:
"jpeg"
"png"
"webp"
null
null
builder.thumbnail.prefer_smallest_formatBooleanUse smallest format when possibletrue
builder.thumbnail.qualityStringQuality setting. One of:
"low"
"medium"
"high"
"medium"

claim_generator_info

The builder.claim_generator_info specifies the default claim generator information. It's a JSON object as described in the table below. It can have additional custom properties as needed by an implementation.

PropertyTypeDescriptionDefault value
nameStringA human readable string naming the claim_generatorN/A - Required
versionStringA human readable string of the product's versionnull
iconUriOrResourceHashed URI to the icon (either embedded or remote)null
operating_systemStringHuman readable string of the OS the claim generator is running onnull

Only the name property is required. For example:

  {
"name": "Adobe Content Authenticity",
"com.adobe.aca-version": "81c4a25",
"org.cai.c2pa_rs": "0.49.3"
}

cawg_trust

The cawg_trust object specifies configuration for CAWG (Creator Assertions Working Group) validation when an X.509 certificate is used. Its structure identical to trust.

For certificate properties, use PEM format strings with \n for line breaks.

PropertyTypeDescriptionDefault value
cawg_trust.verify_trust_listBooleanEnforce verification against the CAWG trust listtrue
cawg_trust.user_anchorsStringAdditional user-provided root certificates (PEM format)N/A
cawg_trust.trust_anchorsStringDefault trust anchor root certificates (PEM format)N/A
cawg_trust.trust_configStringAllowed extended key usage (EKU) object identifiersN/A
cawg_trust.allowed_listStringExplicitly allowed certificates (PEM format)N/A

cawg_x509_signer

The cawg_x509_signer object specifies configuration for the CAWG X.509 signer that generates identity assertions. It has the same structure as signer (local or remote).

When both signer and cawg_x509_signer are configured, the system creates a dual signer that:

  • Uses signer configuration for the main C2PA claim signature.
  • Uses cawg_x509_signer configuration to generate CAWG identity assertions with X.509 credentials.

Local CAWG signer

PropertyTypeDescriptionDefault value
cawg_x509_signer.localObjectLocal CAWG X.509 signerN/A
cawg_x509_signer.local.algStringSigning algorithm for CAWG identity. One of:
"ps256"
"ps384"
"ps512"
"es256"
"es384"
"es512"
"ed25519"
N/A
cawg_x509_signer.local.sign_certStringCertificate chain for signing (PEM format)N/A
cawg_x509_signer.local.private_keyStringPrivate key for signing (PEM format)N/A
cawg_x509_signer.local.tsa_urlStringTime stamp authority URL for timestampingnull

Remote CAWG signer

Remote signers receive POST requests with the data to be signed as the request body, and return the signature data.

PropertyTypeDescriptionDefault value
cawg_x509_signer.remoteObjectRemote CAWG X.509 signer. NOTE: Remote CAWG X.509 signing is not yet implemented.N/A
cawg_x509_signer.remote.urlStringURL to the remote signing service (receives POST with byte stream)N/A
cawg_x509_signer.remote.algStringSigning algorithm used by the remote CAWG identity service. One of:
"ps256"
"ps384"
"ps512"
"es256"
"es384"
"es512"
"ed25519"
N/A
cawg_x509_signer.remote.sign_certStringCertificate chain for the remote signer (PEM format)N/A
cawg_x509_signer.remote.tsa_urlStringTime stamp authority URLnull

core

The core object specifies core features and performance settings.

PropertyTypeDescriptionDefault value
core.merkle_tree_chunk_size_in_kbNumberChunk size for BMFF hash Merkle trees in KB
core.merkle_tree_max_proofsNumberMaximum Merkle tree proofs when validating5
core.backing_store_memory_threshold_in_mbNumberMemory threshold before using disk storage (MB)512
core.decode_identity_assertionsBooleanWhether to decode CAWG identity assertionstrue

signer

The signer object specifies configuration for the primary C2PA signer. Can be null, a local object, or a remote object with values as described below.

When both signer and cawg_x509_signer are configured, the system creates a dual signer that:

  • Uses signer configuration for the main C2PA claim signature.
  • Uses cawg_x509_signer configuration to generate CAWG identity assertions with X.509 credentials.

Local signer

PropertyTypeDescriptionDefault value
signer.localObjectLocal signerN/A
signer.local.algStringSigning algorithm. One of:
"ps256"
"ps384"
"ps512"
"es256"
"es384"
"es512"
"ed25519"
N/A
signer.local.sign_certStringCertificate chain for signing (PEM format)N/A
signer.local.private_keyStringPrivate key for signing (PEM format)N/A
signer.local.tsa_urlStringTime stamp authority URL for timestampingnull

Remote signer

Remote signers receive POST requests with the data to be signed as the request body, and return the signature data.

PropertyTypeDescriptionDefault value
signer.remoteObjectRemote signer. NOTE: Remote signers are not supported in WASM builds.N/A
signer.remote.urlStringURL to the remote signing service (receives POST with byte stream)N/A
signer.remote.algStringSigning algorithm used by the remote service. One of:
"ps256"
"ps384"
"ps512"
"es256"
"es384"
"es512"
"ed25519"
N/A
signer.remote.sign_certStringCertificate chain for the remote signer (PEM format)N/A
signer.remote.tsa_urlStringTime stamp authority URLnull

trust

The trust object specifies the configuration for C2PA certificate trust validation.

For certificate properties, use PEM format strings with \n for line breaks.

PropertyTypeDescriptionDefault value
trust.user_anchorsStringAdditional user-provided root certificates (PEM format)N/A
trust.trust_anchorsStringDefault trust anchor root certificates (PEM format)N/A
trust.trust_configStringAllowed extended key usage (EKU) object identifiersN/A
trust.allowed_listStringExplicitly allowed certificates (PEM format)N/A

verify

The verify object specifies verification behavior.

PropertyTypeDescriptionDefault value
verify.verify_after_readingBooleanVerify manifests after readingtrue
verify.verify_after_signBooleanVerify manifests after signingtrue
verify.verify_trustBooleanVerify certificates against trust liststrue
verify.verify_timestamp_trustBooleanVerify time-stamp certificatestrue
verify.ocsp_fetchBooleanFetch OCSP status during validationfalse
verify.remote_manifest_fetchBooleanFetch remote manifeststrue
verify.skip_ingredient_conflict_resolutionBooleanSkip ingredient conflict resolutionfalse
verify.strict_v1_validationBooleanUse strict C2PA v1 validationfalse

Examples

Minimal configuration

{
"version": 1,
"builder": {
"claim_generator": {
"name": "my app",
"version": "0.1"
},
"intent": {"Create": "digitalCapture"}
}
}

Local signer configuration

{
"version": 1,
"signer": {
"local": {
"alg": "ps256",
"sign_cert": "-----BEGIN CERTIFICATE-----\nMIIExample...\n-----END CERTIFICATE-----",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIExample...\n-----END PRIVATE KEY-----",
"tsa_url": "http://timestamp.digicert.com"
}
},
"builder": {
"intent": {"Create": "digitalCapture"}
}
}

Remote signer configuration

{
"version": 1,
"signer": {
"remote": {
"url": "https://my-signing-service.com/sign",
"alg": "ps256",
"sign_cert": "-----BEGIN CERTIFICATE-----\nMIIExample...\n-----END CERTIFICATE-----",
"tsa_url": "http://timestamp.digicert.com"
}
}
}

CAWG dual signer configuration

{
"version": 1,
"signer": {
"local": {
"alg": "ps256",
"sign_cert": "-----BEGIN CERTIFICATE-----\nC2PA Cert...\n-----END CERTIFICATE-----",
"private_key": "-----BEGIN PRIVATE KEY-----\nC2PA Key...\n-----END PRIVATE KEY-----"
}
},
"cawg_x509_signer": {
"local": {
"alg": "es256",
"sign_cert": "-----BEGIN CERTIFICATE-----\nCAWG Cert...\n-----END CERTIFICATE-----",
"private_key": "-----BEGIN PRIVATE KEY-----\nCAWG Key...\n-----END PRIVATE KEY-----"
}
}
}

Development configuration

{
"version": 1,
"verify": {
"verify_trust": false,
"verify_timestamp_trust": false
},
"builder": {
"thumbnail": {
"enabled": false
}
}
}

Production configuration

{
"version": 1,
"trust": {
"trust_anchors": "-----BEGIN CERTIFICATE-----\n...",
"trust_config": "1.3.6.1.5.5.7.3.4\n1.3.6.1.5.5.7.3.36"
},
"core": {
"backing_store_memory_threshold_in_mb": 1024
},
"builder": {
"intent": {"Create": "digitalCapture"},
"thumbnail": {
"long_edge": 512,
"quality": "high"
}
}
}