diff --git a/_data/Builder_schema.json b/_data/Builder_schema.json new file mode 100644 index 0000000..a72d030 --- /dev/null +++ b/_data/Builder_schema.json @@ -0,0 +1,1394 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Builder", + "description": "Use a Builder to add a signed manifest to an asset.\n\n# Example: Building and signing a manifest\n\n```ignore-wasm32\nuse c2pa::Result;\nuse std::path::PathBuf;\n\nuse c2pa::{create_signer, Builder, SigningAlg};\nuse serde::Serialize;\nuse serde_json::json;\nuse tempfile::tempdir;\n\n#[derive(Serialize)]\nstruct Test {\n my_tag: usize,\n}\n\n# fn main() -> Result<()> {\n#[cfg(feature = \"file_io\")]\n{\n let manifest_json = json!({\n \"claim_generator_info\": [\n {\n \"name\": \"c2pa_test\",\n \"version\": \"1.0.0\"\n }\n ],\n \"title\": \"Test_Manifest\"\n }).to_string();\n\n let mut builder = Builder::from_json(&manifest_json)?;\n builder.add_assertion(\"org.contentauth.test\", &Test { my_tag: 42 })?;\n\n let source = PathBuf::from(\"tests/fixtures/C.jpg\");\n let dir = tempdir()?;\n let dest = dir.path().join(\"test_file.jpg\");\n\n // Create a ps256 signer using certs and key files. TO DO: Update example.\n let signcert_path = \"tests/fixtures/certs/ps256.pub\";\n let pkey_path = \"tests/fixtures/certs/ps256.pem\";\n let signer = create_signer::from_files(signcert_path, pkey_path, SigningAlg::Ps256, None)?;\n\n // embed a manifest using the signer\n builder.sign_file(\n signer.as_ref(),\n &source,\n &dest)?;\n }\n# Ok(())\n# }\n```", + "type": "object", + "properties": { + "claim_version": { + "description": "The version of the claim. Defaults to 2.", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "minimum": 0, + "maximum": 255 + }, + "vendor": { + "description": "Optional prefix added to the generated Manifest Label\nThis is typically a reverse domain name.", + "type": [ + "string", + "null" + ] + }, + "claim_generator_info": { + "description": "Claim Generator Info is always required with an entry", + "type": "array", + "items": { + "$ref": "#/$defs/ClaimGeneratorInfo" + }, + "default": [ + { + "name": "c2pa-rs", + "version": "0.70.0" + } + ] + }, + "metadata": { + "description": "Optional manifest metadata. This will be deprecated in the future; not recommended to use.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssertionMetadata" + } + }, + "title": { + "description": "A human-readable title, generally source filename.", + "type": [ + "string", + "null" + ] + }, + "format": { + "description": "The format of the source file as a MIME type.", + "type": "string", + "default": "application/octet-stream" + }, + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "type": "string", + "default": "xmp:iid:d5b75318-174b-42a6-9f89-69c3d8c87cca" + }, + "thumbnail": { + "description": "An optional ResourceRef to a thumbnail image that represents the asset that was signed.\nMust be available when the manifest is signed.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "ingredients": { + "description": "A List of ingredients", + "type": "array", + "items": { + "$ref": "#/$defs/Ingredient" + }, + "default": [] + }, + "assertions": { + "description": "A list of assertions", + "type": "array", + "items": { + "$ref": "#/$defs/AssertionDefinition" + }, + "default": [] + }, + "redactions": { + "description": "A list of redactions - URIs to redacted assertions.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "label": { + "description": "Allows you to pre-define the manifest label, which must be unique.\nNot intended for general use. If not set, it will be assigned automatically.", + "type": [ + "string", + "null" + ] + }, + "remote_url": { + "description": "Optional remote URL for the manifest", + "type": [ + "string", + "null" + ] + }, + "no_embed": { + "description": "If true, the manifest store will not be embedded in the asset on sign", + "type": "boolean" + }, + "base_path": { + "description": "Base path to search for resources.", + "type": [ + "string", + "null" + ], + "deprecated": true + }, + "intent": { + "description": "A builder should construct a created, opened or updated manifest.", + "anyOf": [ + { + "$ref": "#/$defs/BuilderIntent" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "no_embed" + ], + "$defs": { + "ClaimGeneratorInfo": { + "description": "Description of the claim generator, or the software used in generating the claim.\n\nThis structure is also used for actions softwareAgent", + "type": "object", + "properties": { + "name": { + "description": "A human readable string naming the claim_generator", + "type": "string" + }, + "version": { + "description": "A human readable string of the product's version", + "type": [ + "string", + "null" + ] + }, + "icon": { + "description": "hashed URI to the icon (either embedded or remote)", + "anyOf": [ + { + "$ref": "#/$defs/UriOrResource" + }, + { + "type": "null" + } + ] + }, + "operating_system": { + "description": "A human readable string of the OS the claim generator is running on", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": true + }, + "UriOrResource": { + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "$ref": "#/$defs/HashedUri" + } + ] + }, + "ResourceRef": { + "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", + "type": "object", + "properties": { + "format": { + "description": "The mime type of the referenced resource.", + "type": "string" + }, + "identifier": { + "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string.\nRelative JUMBF URIs will be resolved with the manifest label.\nRelative file paths will be resolved with the base path if provided.", + "type": "string" + }, + "data_types": { + "description": "More detailed data types as defined in the C2PA spec.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssetType" + } + }, + "alg": { + "description": "The algorithm used to hash the resource (if applicable).", + "type": [ + "string", + "null" + ] + }, + "hash": { + "description": "The hash of the resource (if applicable).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "format", + "identifier" + ] + }, + "AssetType": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "version": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type" + ] + }, + "HashedUri": { + "description": "A `HashedUri` provides a reference to content available within the same\nmanifest store.\n\nThis is described in [§8.3, URI References], of the C2PA Technical\nSpecification.\n\n[§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references", + "type": "object", + "properties": { + "url": { + "description": "JUMBF URI reference", + "type": "string" + }, + "alg": { + "description": "A string identifying the cryptographic hash algorithm used to compute\nthe hash", + "type": [ + "string", + "null" + ] + }, + "hash": { + "description": "Byte string containing the hash value", + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 + } + } + }, + "required": [ + "url", + "hash" + ] + }, + "AssertionMetadata": { + "description": "The AssertionMetadata structure can be used as part of other assertions or on its own to reference others", + "type": "object", + "properties": { + "reviewRatings": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ReviewRating" + } + }, + "dateTime": { + "anyOf": [ + { + "$ref": "#/$defs/DateT" + }, + { + "type": "null" + } + ] + }, + "reference": { + "anyOf": [ + { + "$ref": "#/$defs/HashedUri" + }, + { + "type": "null" + } + ] + }, + "dataSource": { + "anyOf": [ + { + "$ref": "#/$defs/DataSource" + }, + { + "type": "null" + } + ] + }, + "localizations": { + "type": [ + "array", + "null" + ], + "items": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "regionOfInterest": { + "anyOf": [ + { + "$ref": "#/$defs/RegionOfInterest" + }, + { + "type": "null" + } + ] + } + } + }, + "ReviewRating": { + "description": "A rating on an Assertion.\n\nSee .", + "type": "object", + "properties": { + "explanation": { + "type": "string" + }, + "code": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "explanation", + "value" + ] + }, + "DateT": { + "type": "string" + }, + "DataSource": { + "description": "A description of the source for assertion data", + "type": "object", + "properties": { + "type": { + "description": "A value from among the enumerated list indicating the source of the assertion.", + "type": "string" + }, + "details": { + "description": "A human-readable string giving details about the source of the assertion data.", + "type": [ + "string", + "null" + ] + }, + "actors": { + "description": "A list of [`Actor`]s associated with this source.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/Actor" + } + } + }, + "required": [ + "type" + ] + }, + "Actor": { + "description": "Identifies a person responsible for an action.", + "type": "object", + "properties": { + "identifier": { + "description": "An identifier for a human actor, used when the \"type\" is `humanEntry.identified`.", + "type": [ + "string", + "null" + ] + }, + "credentials": { + "description": "List of references to W3C Verifiable Credentials.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/HashedUri" + } + } + } + }, + "RegionOfInterest": { + "description": "A region of interest within an asset describing the change.\n\nThis struct can be used from [`Action::changes`][crate::assertions::Action::changes],\n[`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or\n[`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].", + "type": "object", + "properties": { + "region": { + "description": "A range describing the region of interest for the specific asset.", + "type": "array", + "items": { + "$ref": "#/$defs/Range" + } + }, + "name": { + "description": "A free-text string representing a human-readable name for the region which might be used in a user interface.", + "type": [ + "string", + "null" + ] + }, + "identifier": { + "description": "A free-text string representing a machine-readable, unique to this assertion, identifier for the region.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "A value from a controlled vocabulary such as or an entity-specific\nvalue (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.\n\nNote this field serializes/deserializes into the name `type`.", + "type": [ + "string", + "null" + ] + }, + "role": { + "description": "A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents\nthe role of a region among other regions.", + "anyOf": [ + { + "$ref": "#/$defs/Role" + }, + { + "type": "null" + } + ] + }, + "description": { + "description": "A free-text string.", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "description": "Additional information about the asset.", + "anyOf": [ + { + "$ref": "#/$defs/AssertionMetadata" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "region" + ] + }, + "Range": { + "description": "A spatial, temporal, frame, or textual range describing the region of interest.", + "type": "object", + "properties": { + "type": { + "description": "The type of range of interest.", + "$ref": "#/$defs/RangeType" + }, + "shape": { + "description": "A spatial range.", + "anyOf": [ + { + "$ref": "#/$defs/Shape" + }, + { + "type": "null" + } + ] + }, + "time": { + "description": "A temporal range.", + "anyOf": [ + { + "$ref": "#/$defs/Time" + }, + { + "type": "null" + } + ] + }, + "frame": { + "description": "A frame range.", + "anyOf": [ + { + "$ref": "#/$defs/Frame" + }, + { + "type": "null" + } + ] + }, + "text": { + "description": "A textual range.", + "anyOf": [ + { + "$ref": "#/$defs/Text" + }, + { + "type": "null" + } + ] + }, + "item": { + "description": "A item identifier.", + "anyOf": [ + { + "$ref": "#/$defs/Item" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type" + ] + }, + "RangeType": { + "description": "The type of range for the region of interest.", + "oneOf": [ + { + "description": "A spatial range, see [`Shape`] for more details.", + "type": "string", + "const": "spatial" + }, + { + "description": "A temporal range, see [`Time`] for more details.", + "type": "string", + "const": "temporal" + }, + { + "description": "A spatial range, see [`Frame`] for more details.", + "type": "string", + "const": "frame" + }, + { + "description": "A textual range, see [`Text`] for more details.", + "type": "string", + "const": "textual" + }, + { + "description": "A range identified by a specific identifier and value, see [`Item`] for more details.", + "type": "string", + "const": "identified" + } + ] + }, + "Shape": { + "description": "A spatial range representing rectangle, circle, or a polygon.", + "type": "object", + "properties": { + "type": { + "description": "The type of shape.", + "$ref": "#/$defs/ShapeType" + }, + "unit": { + "description": "The type of unit for the shape range.", + "$ref": "#/$defs/UnitType" + }, + "origin": { + "description": "THe origin of the coordinate in the shape.", + "$ref": "#/$defs/Coordinate" + }, + "width": { + "description": "The width for rectangles or diameter for circles.\n\nThis field can be ignored for polygons.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "height": { + "description": "The height of a rectnagle.\n\nThis field can be ignored for circles and polygons.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "inside": { + "description": "If the range is inside the shape.\n\nThe default value is true.", + "type": [ + "boolean", + "null" + ] + }, + "vertices": { + "description": "The vertices of the polygon.\n\nThis field can be ignored for rectangles and circles.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/Coordinate" + } + } + }, + "required": [ + "type", + "unit", + "origin" + ] + }, + "ShapeType": { + "description": "The type of shape for the range.", + "oneOf": [ + { + "description": "A rectangle.", + "type": "string", + "const": "rectangle" + }, + { + "description": "A circle.", + "type": "string", + "const": "circle" + }, + { + "description": "A polygon.", + "type": "string", + "const": "polygon" + } + ] + }, + "UnitType": { + "description": "The type of unit for the range.", + "oneOf": [ + { + "description": "Use pixels.", + "type": "string", + "const": "pixel" + }, + { + "description": "Use percentage.", + "type": "string", + "const": "percent" + } + ] + }, + "Coordinate": { + "description": "An x, y coordinate used for specifying vertices in polygons.", + "type": "object", + "properties": { + "x": { + "description": "The coordinate along the x-axis.", + "type": "number", + "format": "double" + }, + "y": { + "description": "The coordinate along the y-axis.", + "type": "number", + "format": "double" + } + }, + "required": [ + "x", + "y" + ] + }, + "Time": { + "description": "A temporal range representing a starting time to an ending time.", + "type": "object", + "properties": { + "type": { + "description": "The type of time.", + "$ref": "#/$defs/TimeType", + "default": "npt" + }, + "start": { + "description": "The start time or the start of the asset if not present.", + "type": [ + "string", + "null" + ] + }, + "end": { + "description": "The end time or the end of the asset if not present.", + "type": [ + "string", + "null" + ] + } + } + }, + "TimeType": { + "description": "The type of time.", + "oneOf": [ + { + "description": "Times are described using Normal Play Time (npt) as described in RFC 2326.", + "type": "string", + "const": "npt" + } + ] + }, + "Frame": { + "description": "A frame range representing starting and ending frames or pages.\n\nIf both `start` and `end` are missing, the frame will span the entire asset.", + "type": "object", + "properties": { + "start": { + "description": "The start of the frame or the end of the asset if not present.\n\nThe first frame/page starts at 0.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "end": { + "description": "The end of the frame inclusive or the end of the asset if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + } + } + }, + "Text": { + "description": "A textual range representing multiple (possibly discontinuous) ranges of text.", + "type": "object", + "properties": { + "selectors": { + "description": "The ranges of text to select.", + "type": "array", + "items": { + "$ref": "#/$defs/TextSelectorRange" + } + } + }, + "required": [ + "selectors" + ] + }, + "TextSelectorRange": { + "description": "One or two [`TextSelector`][TextSelector] identifiying the range to select.", + "type": "object", + "properties": { + "selector": { + "description": "The start (or entire) text range.", + "$ref": "#/$defs/TextSelector" + }, + "end": { + "description": "The end of the text range.", + "anyOf": [ + { + "$ref": "#/$defs/TextSelector" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "selector" + ] + }, + "TextSelector": { + "description": "Selects a range of text via a fragment identifier.\n\nThis is modeled after the W3C Web Annotation selector model.", + "type": "object", + "properties": { + "fragment": { + "description": "Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.", + "type": "string" + }, + "start": { + "description": "The start character offset or the start of the fragment if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "end": { + "description": "The end character offset or the end of the fragment if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + } + }, + "required": [ + "fragment" + ] + }, + "Item": { + "description": "Description of the boundaries of an identified range.", + "type": "object", + "properties": { + "identifier": { + "description": "The container-specific term used to identify items, such as \"track_id\" for MP4 or \"item_ID\" for HEIF.", + "type": "string" + }, + "value": { + "description": "The value of the identifier, e.g. a value of \"2\" for an identifier of \"track_id\" would imply track 2 of the asset.", + "type": "string" + } + }, + "required": [ + "identifier", + "value" + ] + }, + "Role": { + "description": "A role describing the region.", + "oneOf": [ + { + "description": "Arbitrary area worth identifying.", + "type": "string", + "const": "c2pa.areaOfInterest" + }, + { + "description": "This area is all that is left after a crop action.", + "type": "string", + "const": "c2pa.cropped" + }, + { + "description": "This area has had edits applied to it.", + "type": "string", + "const": "c2pa.edited" + }, + { + "description": "The area where an ingredient was placed/added.", + "type": "string", + "const": "c2pa.placed" + }, + { + "description": "Something in this area was redacted.", + "type": "string", + "const": "c2pa.redacted" + }, + { + "description": "Area specific to a subject (human or not).", + "type": "string", + "const": "c2pa.subjectArea" + }, + { + "description": "A range of information was removed/deleted.", + "type": "string", + "const": "c2pa.deleted" + }, + { + "description": "Styling was applied to this area.", + "type": "string", + "const": "c2pa.styled" + }, + { + "description": "Invisible watermarking was applied to this area for the purpose of soft binding.", + "type": "string", + "const": "c2pa.watermarked" + } + ] + }, + "Ingredient": { + "description": "An `Ingredient` is any external asset that has been used in the creation of an asset.", + "type": "object", + "properties": { + "title": { + "description": "A human-readable title, generally source filename.", + "type": [ + "string", + "null" + ] + }, + "format": { + "description": "The format of the source file as a MIME type.", + "type": [ + "string", + "null" + ] + }, + "document_id": { + "description": "Document ID from `xmpMM:DocumentID` in XMP metadata.", + "type": [ + "string", + "null" + ] + }, + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "type": [ + "string", + "null" + ] + }, + "provenance": { + "description": "URI from `dcterms:provenance` in XMP metadata.", + "type": [ + "string", + "null" + ] + }, + "thumbnail": { + "description": "A thumbnail image capturing the visual state at the time of import.\n\nA tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "hash": { + "description": "An optional hash of the asset to prevent duplicates.", + "type": [ + "string", + "null" + ] + }, + "relationship": { + "description": "Set to `ParentOf` if this is the parent ingredient.\n\nThere can only be one parent ingredient in the ingredients.", + "$ref": "#/$defs/Relationship", + "default": "componentOf" + }, + "active_manifest": { + "description": "The active manifest label (if one exists).\n\nIf this ingredient has a [`ManifestStore`],\nthis will hold the label of the active [`Manifest`].\n\n[`Manifest`]: crate::Manifest\n[`ManifestStore`]: crate::ManifestStore", + "type": [ + "string", + "null" + ] + }, + "validation_status": { + "description": "Validation status (Ingredient v1 & v2)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ValidationStatus" + } + }, + "validation_results": { + "description": "Validation results (Ingredient.V3)", + "anyOf": [ + { + "$ref": "#/$defs/ValidationResults" + }, + { + "type": "null" + } + ] + }, + "data": { + "description": "A reference to the actual data of the ingredient.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "description": { + "description": "Additional description of the ingredient.", + "type": [ + "string", + "null" + ] + }, + "informational_URI": { + "description": "URI to an informational page about the ingredient or its data.", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "description": "Any additional [`Metadata`] as defined in the C2PA spec.\n\n[`Metadata`]: crate::Metadata", + "anyOf": [ + { + "$ref": "#/$defs/AssertionMetadata" + }, + { + "type": "null" + } + ] + }, + "data_types": { + "description": "Additional information about the data's type to the ingredient V2 structure.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssetType" + } + }, + "manifest_data": { + "description": "A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.\n\n[`ManifestStore`]: crate::ManifestStore", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "label": { + "description": "The ingredient's label as assigned in the manifest.", + "type": [ + "string", + "null" + ] + }, + "ocsp_responses": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ResourceRef" + } + } + } + }, + "Relationship": { + "description": "The relationship of the ingredient to the current asset.", + "oneOf": [ + { + "description": "The current asset is derived from this ingredient.", + "type": "string", + "const": "parentOf" + }, + { + "description": "The current asset is a part of this ingredient.", + "type": "string", + "const": "componentOf" + }, + { + "description": "The ingredient was used as an input to a computational process to create or modify the asset.", + "type": "string", + "const": "inputTo" + } + ] + }, + "ValidationStatus": { + "description": "A `ValidationStatus` struct describes the validation status of a\nspecific part of a manifest.\n\nSee .", + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "explanation": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": [ + "boolean", + "null" + ], + "writeOnly": true + } + }, + "required": [ + "code" + ] + }, + "ValidationResults": { + "description": "A map of validation results for a manifest store.\n\nThe map contains the validation results for the active manifest and any ingredient deltas.\nIt is normal for there to be many", + "type": "object", + "properties": { + "activeManifest": { + "description": "Validation status codes for the ingredient's active manifest. Present if ingredient is a C2PA\nasset. Not present if the ingredient is not a C2PA asset.", + "anyOf": [ + { + "$ref": "#/$defs/StatusCodes" + }, + { + "type": "null" + } + ] + }, + "ingredientDeltas": { + "description": "List of any changes/deltas between the current and previous validation results for each ingredient's\nmanifest. Present if the the ingredient is a C2PA asset.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/IngredientDeltaValidationResult" + } + } + } + }, + "StatusCodes": { + "description": "Contains a set of success, informational, and failure validation status codes.", + "type": "object", + "properties": { + "success": { + "description": "An array of validation success codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + }, + "informational": { + "description": "An array of validation informational codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + }, + "failure": { + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + } + }, + "required": [ + "success", + "informational", + "failure" + ] + }, + "IngredientDeltaValidationResult": { + "description": "Represents any changes or deltas between the current and previous validation results for an ingredient's manifest.", + "type": "object", + "properties": { + "ingredientAssertionURI": { + "description": "JUMBF URI reference to the ingredient assertion", + "type": "string" + }, + "validationDeltas": { + "description": "Validation results for the ingredient's active manifest", + "$ref": "#/$defs/StatusCodes" + } + }, + "required": [ + "ingredientAssertionURI", + "validationDeltas" + ] + }, + "AssertionDefinition": { + "description": "Defines an assertion that consists of a label that can be either\na C2PA-defined assertion label or a custom label in reverse domain format.", + "type": "object", + "properties": { + "label": { + "description": "An assertion label in reverse domain format", + "type": "string" + }, + "data": { + "description": "The assertion data", + "$ref": "#/$defs/AssertionData" + }, + "kind": { + "description": "The kind of assertion data, either Cbor or Json (defaults to Cbor)", + "anyOf": [ + { + "$ref": "#/$defs/ManifestAssertionKind" + }, + { + "type": "null" + } + ] + }, + "created": { + "description": "True if this assertion is attributed to the signer (defaults to false)", + "type": "boolean" + } + }, + "required": [ + "label", + "data" + ] + }, + "AssertionData": { + "description": "This allows the assertion to be expressed as CBOR or JSON.\nThe default is CBOR unless you specify that an assertion should be JSON.", + "anyOf": [ + true + ] + }, + "ManifestAssertionKind": { + "description": "Assertions in C2PA can be stored in several formats", + "type": "string", + "enum": [ + "Cbor", + "Json", + "Binary", + "Uri" + ] + }, + "BuilderIntent": { + "description": "Represents the type of builder flow being used.\n\nThis determines how the builder will be used, such as creating a new asset, opening an existing asset,\nor updating an existing asset.", + "oneOf": [ + { + "description": "This is a new digital creation, a DigitalSourceType is required.\n\nThe Manifest must not have have a parent ingredient.\nA `c2pa.created` action will be added if not provided.", + "type": "object", + "properties": { + "create": { + "$ref": "#/$defs/DigitalSourceType" + } + }, + "required": [ + "create" + ], + "additionalProperties": false + }, + { + "description": "This is an edit of a pre-existing parent asset.\n\nThe Manifest must have a parent ingredient.\nA parent ingredient will be generated from the source stream if not otherwise provided.\nA `c2pa.opened action will be tied to the parent ingredient.", + "type": "string", + "const": "edit" + }, + { + "description": "A restricted version of Edit for non-editorial changes.\n\nThere must be only one ingredient, as a parent.\nNo changes can be made to the hashed content of the parent.\nThere are additional restrictions on the types of changes that can be made.", + "type": "string", + "const": "update" + } + ] + }, + "DigitalSourceType": { + "description": "Description of the source of an asset.\n\nThe full list of possible digital source types are found below:\n\n", + "anyOf": [ + { + "description": "Media whose digital content is effectively empty, such as a blank canvas or zero-length video.", + "type": "string", + "const": "http://c2pa.org/digitalsourcetype/empty" + }, + { + "description": "Data that is the result of algorithmically using a model derived from sampled content and data.\nDiffers from trainedAlgorithmicMedia in that\nthe result isn’t a media type (e.g., image or video) but is a data format (e.g., CSV, pickle).", + "type": "string", + "const": "http://c2pa.org/digitalsourcetype/trainedAlgorithmicData" + }, + { + "description": "The media was captured from a real-life source using a digital camera or digital recording device.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture" + }, + { + "description": "The media is the result of capturing multiple frames from a real-life source using a digital camera\nor digital recording device, then automatically merging them into a single frame using digital signal\nprocessing techniques and/or non-generative AI. Includes High Dynamic Range (HDR) processing common in\nsmartphone camera apps.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/computationalCapture" + }, + { + "description": "The media was digitised from a negative on film or other transparent medium.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm" + }, + { + "description": "The media was digitised from a positive on a transparency or other transparent medium.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm" + }, + { + "description": "The media was digitised from a non-transparent medium such as a photographic print.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/print" + }, + { + "description": "Minor augmentation or correction by a human, such as a digitally-retouched photo used in a magazine.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/minorHumanEdits", + "deprecated": true + }, + { + "description": "Augmentation, correction or enhancement by one or more humans using non-generative tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/humanEdits" + }, + { + "description": "Augmentation, correction or enhancement using a Generative AI model, such as with inpainting or\noutpainting operations.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia" + }, + { + "description": "Modification or correction by algorithm without changing the main content of the media, initiated\nor configured by a human, such as sharpening or applying noise reduction.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicallyEnhanced" + }, + { + "description": "The digital image was created by computer software.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage", + "deprecated": true + }, + { + "description": "Media created by a human using digital tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalArt", + "deprecated": true + }, + { + "description": "Media created by a human using non-generative tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation" + }, + { + "description": "Digital media representation of data via human programming or creativity.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/dataDrivenMedia" + }, + { + "description": "Digital media created algorithmically using an Artificial Intelligence model trained on captured\ncontent.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia" + }, + { + "description": "Media created purely by an algorithm not based on any sampled training data, e.g. an image created\nby software using a mathematical formula.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicMedia" + }, + { + "description": "A capture of the contents of the screen of a computer or mobile device.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/screenCapture" + }, + { + "description": "Live recording of virtual event based on Generative AI and/or captured elements.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/virtualRecording" + }, + { + "description": "Mix or composite of several elements, any of which may or may not be generative AI.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/composite" + }, + { + "description": "Mix or composite of several elements that are all captures of real life.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeCapture" + }, + { + "description": "Mix or composite of several elements, at least one of which is Generative AI.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeSynthetic" + }, + { + "description": "An unknown digital source type.", + "type": "string" + } + ] + } + } +} \ No newline at end of file diff --git a/_data/ManifestDefinition_schema.json b/_data/ManifestDefinition_schema.json index 6417245..f743979 100644 --- a/_data/ManifestDefinition_schema.json +++ b/_data/ManifestDefinition_schema.json @@ -1,30 +1,9 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "ManifestDefinition", - "description": "Use a ManifestDefinition to define a manifest and to build a `ManifestStore`. A manifest is a collection of ingredients and assertions used to define a claim that can be signed and embedded into a file.", + "description": "Use a ManifestDefinition to define a manifest and to build a `ManifestStore`.\nA manifest is a collection of ingredients and assertions\nused to define a claim that can be signed and embedded into a file.", "type": "object", "properties": { - "assertions": { - "description": "A list of assertions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/AssertionDefinition" - } - }, - "claim_generator_info": { - "description": "Claim Generator Info is always required with at least one entry", - "default": [ - { - "name": "c2pa-rs", - "version": "0.64.0" - } - ], - "type": "array", - "items": { - "$ref": "#/definitions/ClaimGeneratorInfo" - } - }, "claim_version": { "description": "The version of the claim. Defaults to 2.", "type": [ @@ -32,33 +11,29 @@ "null" ], "format": "uint8", - "minimum": 0.0 + "minimum": 0, + "maximum": 255 }, - "format": { - "description": "The format of the source file as a MIME type.", - "default": "application/octet-stream", - "type": "string" - }, - "ingredients": { - "description": "A List of ingredients", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Ingredient" - } - }, - "instance_id": { - "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", - "default": "xmp:iid:f8f5adf0-f9ee-4168-8f62-520d718bf08f", - "type": "string" - }, - "label": { - "description": "Allows you to pre-define the manifest label, which must be unique. Not intended for general use. If not set, it will be assigned automatically.", + "vendor": { + "description": "Optional prefix added to the generated Manifest Label\nThis is typically a reverse domain name.", "type": [ "string", "null" ] }, + "claim_generator_info": { + "description": "Claim Generator Info is always required with an entry", + "type": "array", + "items": { + "$ref": "#/$defs/ClaimGeneratorInfo" + }, + "default": [ + { + "name": "c2pa-rs", + "version": "0.70.0" + } + ] + }, "metadata": { "description": "Optional manifest metadata. This will be deprecated in the future; not recommended to use.", "type": [ @@ -66,119 +41,248 @@ "null" ], "items": { - "$ref": "#/definitions/AssertionMetadata" + "$ref": "#/$defs/AssertionMetadata" } }, - "redactions": { - "description": "A list of redactions - URIs to redacted assertions.", + "title": { + "description": "A human-readable title, generally source filename.", "type": [ - "array", + "string", "null" - ], - "items": { - "type": "string" - } + ] + }, + "format": { + "description": "The format of the source file as a MIME type.", + "type": "string", + "default": "application/octet-stream" + }, + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "type": "string", + "default": "xmp:iid:610200f6-9916-47c4-9212-0c0abee8181e" }, "thumbnail": { - "description": "An optional ResourceRef to a thumbnail image that represents the asset that was signed. Must be available when the manifest is signed.", + "description": "An optional ResourceRef to a thumbnail image that represents the asset that was signed.\nMust be available when the manifest is signed.", "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/ResourceRef" }, { "type": "null" } ] }, - "title": { - "description": "A human-readable title, generally source filename.", + "ingredients": { + "description": "A List of ingredients", + "type": "array", + "items": { + "$ref": "#/$defs/Ingredient" + }, + "default": [] + }, + "assertions": { + "description": "A list of assertions", + "type": "array", + "items": { + "$ref": "#/$defs/AssertionDefinition" + }, + "default": [] + }, + "redactions": { + "description": "A list of redactions - URIs to redacted assertions.", "type": [ - "string", + "array", "null" - ] + ], + "items": { + "type": "string" + } }, - "vendor": { - "description": "Optional prefix added to the generated Manifest Label This is typically a reverse domain name.", + "label": { + "description": "Allows you to pre-define the manifest label, which must be unique.\nNot intended for general use. If not set, it will be assigned automatically.", "type": [ "string", "null" ] } }, - "definitions": { - "Actor": { - "description": "Identifies a person responsible for an action.", + "$defs": { + "ClaimGeneratorInfo": { + "description": "Description of the claim generator, or the software used in generating the claim.\n\nThis structure is also used for actions softwareAgent", "type": "object", "properties": { - "credentials": { - "description": "List of references to W3C Verifiable Credentials.", + "name": { + "description": "A human readable string naming the claim_generator", + "type": "string" + }, + "version": { + "description": "A human readable string of the product's version", + "type": [ + "string", + "null" + ] + }, + "icon": { + "description": "hashed URI to the icon (either embedded or remote)", + "anyOf": [ + { + "$ref": "#/$defs/UriOrResource" + }, + { + "type": "null" + } + ] + }, + "operating_system": { + "description": "A human readable string of the OS the claim generator is running on", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": true + }, + "UriOrResource": { + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "$ref": "#/$defs/HashedUri" + } + ] + }, + "ResourceRef": { + "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", + "type": "object", + "properties": { + "format": { + "description": "The mime type of the referenced resource.", + "type": "string" + }, + "identifier": { + "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string.\nRelative JUMBF URIs will be resolved with the manifest label.\nRelative file paths will be resolved with the base path if provided.", + "type": "string" + }, + "data_types": { + "description": "More detailed data types as defined in the C2PA spec.", "type": [ "array", "null" ], "items": { - "$ref": "#/definitions/HashedUri" + "$ref": "#/$defs/AssetType" } }, - "identifier": { - "description": "An identifier for a human actor, used when the \"type\" is `humanEntry.identified`.", + "alg": { + "description": "The algorithm used to hash the resource (if applicable).", + "type": [ + "string", + "null" + ] + }, + "hash": { + "description": "The hash of the resource (if applicable).", "type": [ "string", "null" ] } - } + }, + "required": [ + "format", + "identifier" + ] }, - "AssertionData": { - "description": "This allows the assertion to be expressed as CBOR or JSON. The default is CBOR unless you specify that an assertion should be JSON.", - "anyOf": [ - true + "AssetType": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "version": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type" ] }, - "AssertionDefinition": { - "description": "Defines an assertion that consists of a label that can be either a C2PA-defined assertion label or a custom label in reverse domain format.", + "HashedUri": { + "description": "A `HashedUri` provides a reference to content available within the same\nmanifest store.\n\nThis is described in [§8.3, URI References], of the C2PA Technical\nSpecification.\n\n[§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references", "type": "object", + "properties": { + "url": { + "description": "JUMBF URI reference", + "type": "string" + }, + "alg": { + "description": "A string identifying the cryptographic hash algorithm used to compute\nthe hash", + "type": [ + "string", + "null" + ] + }, + "hash": { + "description": "Byte string containing the hash value", + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 + } + } + }, "required": [ - "data", - "label" - ], + "url", + "hash" + ] + }, + "AssertionMetadata": { + "description": "The AssertionMetadata structure can be used as part of other assertions or on its own to reference others", + "type": "object", "properties": { - "data": { - "$ref": "#/definitions/AssertionData" + "reviewRatings": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ReviewRating" + } }, - "kind": { + "dateTime": { "anyOf": [ { - "$ref": "#/definitions/ManifestAssertionKind" + "$ref": "#/$defs/DateT" }, { "type": "null" } ] }, - "label": { - "type": "string" - } - } - }, - "AssertionMetadata": { - "description": "The AssertionMetadata structure can be used as part of other assertions or on its own to reference others", - "type": "object", - "properties": { - "dataSource": { + "reference": { "anyOf": [ { - "$ref": "#/definitions/DataSource" + "$ref": "#/$defs/HashedUri" }, { "type": "null" } ] }, - "dateTime": { + "dataSource": { "anyOf": [ { - "$ref": "#/definitions/DateT" + "$ref": "#/$defs/DataSource" }, { "type": "null" @@ -200,129 +304,53 @@ } } }, - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/HashedUri" - }, - { - "type": "null" - } - ] - }, "regionOfInterest": { "anyOf": [ { - "$ref": "#/definitions/RegionOfInterest" + "$ref": "#/$defs/RegionOfInterest" }, { "type": "null" } ] - }, - "reviewRatings": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ReviewRating" - } } } }, - "AssetType": { + "ReviewRating": { + "description": "A rating on an Assertion.\n\nSee .", "type": "object", - "required": [ - "type" - ], "properties": { - "type": { - "type": "string" - }, - "version": { - "type": [ - "string", - "null" - ] - } - } - }, - "ClaimGeneratorInfo": { - "description": "Description of the claim generator, or the software used in generating the claim.\n\nThis structure is also used for actions softwareAgent", - "type": "object", - "required": [ - "name" - ], - "properties": { - "icon": { - "description": "hashed URI to the icon (either embedded or remote)", - "anyOf": [ - { - "$ref": "#/definitions/UriOrResource" - }, - { - "type": "null" - } - ] - }, - "name": { - "description": "A human readable string naming the claim_generator", + "explanation": { "type": "string" }, - "operating_system": { - "description": "A human readable string of the OS the claim generator is running on", + "code": { "type": [ "string", "null" ] }, - "version": { - "description": "A human readable string of the product's version", - "type": [ - "string", - "null" - ] + "value": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 } }, - "additionalProperties": true - }, - "Coordinate": { - "description": "An x, y coordinate used for specifying vertices in polygons.", - "type": "object", "required": [ - "x", - "y" - ], - "properties": { - "x": { - "description": "The coordinate along the x-axis.", - "type": "number", - "format": "double" - }, - "y": { - "description": "The coordinate along the y-axis.", - "type": "number", - "format": "double" - } - } + "explanation", + "value" + ] + }, + "DateT": { + "type": "string" }, "DataSource": { "description": "A description of the source for assertion data", "type": "object", - "required": [ - "type" - ], "properties": { - "actors": { - "description": "A list of [`Actor`]s associated with this source.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Actor" - } + "type": { + "description": "A value from among the enumerated list indicating the source of the assertion.", + "type": "string" }, "details": { "description": "A human-readable string giving details about the source of the assertion data.", @@ -331,328 +359,145 @@ "null" ] }, - "type": { - "description": "A value from among the enumerated list indicating the source of the assertion.", - "type": "string" - } - } - }, - "DateT": { - "type": "string" - }, - "Frame": { - "description": "A frame range representing starting and ending frames or pages.\n\nIf both `start` and `end` are missing, the frame will span the entire asset.", - "type": "object", - "properties": { - "end": { - "description": "The end of the frame inclusive or the end of the asset if not present.", - "type": [ - "integer", - "null" - ], - "format": "int32" - }, - "start": { - "description": "The start of the frame or the end of the asset if not present.\n\nThe first frame/page starts at 0.", + "actors": { + "description": "A list of [`Actor`]s associated with this source.", "type": [ - "integer", + "array", "null" ], - "format": "int32" + "items": { + "$ref": "#/$defs/Actor" + } } - } + }, + "required": [ + "type" + ] }, - "HashedUri": { - "description": "A `HashedUri` provides a reference to content available within the same manifest store.\n\nThis is described in [§8.3, URI References], of the C2PA Technical Specification.\n\n[§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references", + "Actor": { + "description": "Identifies a person responsible for an action.", "type": "object", - "required": [ - "hash", - "url" - ], "properties": { - "alg": { - "description": "A string identifying the cryptographic hash algorithm used to compute the hash", + "identifier": { + "description": "An identifier for a human actor, used when the \"type\" is `humanEntry.identified`.", "type": [ "string", "null" ] }, - "hash": { - "description": "Byte string containing the hash value", - "type": "array", + "credentials": { + "description": "List of references to W3C Verifiable Credentials.", + "type": [ + "array", + "null" + ], "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 + "$ref": "#/$defs/HashedUri" } - }, - "url": { - "description": "JUMBF URI reference", - "type": "string" } } }, - "Ingredient": { - "description": "An `Ingredient` is any external asset that has been used in the creation of an asset.", + "RegionOfInterest": { + "description": "A region of interest within an asset describing the change.\n\nThis struct can be used from [`Action::changes`][crate::assertions::Action::changes],\n[`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or\n[`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].", "type": "object", "properties": { - "active_manifest": { - "description": "The active manifest label (if one exists).\n\nIf this ingredient has a [`ManifestStore`], this will hold the label of the active [`Manifest`].\n\n[`Manifest`]: crate::Manifest [`ManifestStore`]: crate::ManifestStore", - "type": [ - "string", - "null" - ] - }, - "data": { - "description": "A reference to the actual data of the ingredient.", - "anyOf": [ - { - "$ref": "#/definitions/ResourceRef" - }, - { - "type": "null" - } - ] - }, - "data_types": { - "description": "Additional information about the data's type to the ingredient V2 structure.", - "type": [ - "array", - "null" - ], + "region": { + "description": "A range describing the region of interest for the specific asset.", + "type": "array", "items": { - "$ref": "#/definitions/AssetType" + "$ref": "#/$defs/Range" } }, - "description": { - "description": "Additional description of the ingredient.", - "type": [ - "string", - "null" - ] - }, - "document_id": { - "description": "Document ID from `xmpMM:DocumentID` in XMP metadata.", - "type": [ - "string", - "null" - ] - }, - "format": { - "description": "The format of the source file as a MIME type.", + "name": { + "description": "A free-text string representing a human-readable name for the region which might be used in a user interface.", "type": [ "string", "null" ] }, - "hash": { - "description": "An optional hash of the asset to prevent duplicates.", + "identifier": { + "description": "A free-text string representing a machine-readable, unique to this assertion, identifier for the region.", "type": [ "string", "null" ] }, - "informational_URI": { - "description": "URI to an informational page about the ingredient or its data.", + "type": { + "description": "A value from a controlled vocabulary such as or an entity-specific\nvalue (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.\n\nNote this field serializes/deserializes into the name `type`.", "type": [ "string", "null" ] }, - "instance_id": { - "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", - "type": [ - "string", - "null" + "role": { + "description": "A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents\nthe role of a region among other regions.", + "anyOf": [ + { + "$ref": "#/$defs/Role" + }, + { + "type": "null" + } ] }, - "label": { - "description": "The ingredient's label as assigned in the manifest.", + "description": { + "description": "A free-text string.", "type": [ "string", "null" ] }, - "manifest_data": { - "description": "A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.\n\n[`ManifestStore`]: crate::ManifestStore", + "metadata": { + "description": "Additional information about the asset.", "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/AssertionMetadata" }, { "type": "null" } ] + } + }, + "required": [ + "region" + ] + }, + "Range": { + "description": "A spatial, temporal, frame, or textual range describing the region of interest.", + "type": "object", + "properties": { + "type": { + "description": "The type of range of interest.", + "$ref": "#/$defs/RangeType" }, - "metadata": { - "description": "Any additional [`Metadata`] as defined in the C2PA spec.\n\n[`Metadata`]: crate::Metadata", + "shape": { + "description": "A spatial range.", "anyOf": [ { - "$ref": "#/definitions/AssertionMetadata" + "$ref": "#/$defs/Shape" }, { "type": "null" } ] }, - "ocsp_responses": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ResourceRef" - } - }, - "provenance": { - "description": "URI from `dcterms:provenance` in XMP metadata.", - "type": [ - "string", - "null" - ] - }, - "relationship": { - "description": "Set to `ParentOf` if this is the parent ingredient.\n\nThere can only be one parent ingredient in the ingredients.", - "default": "componentOf", - "allOf": [ + "time": { + "description": "A temporal range.", + "anyOf": [ { - "$ref": "#/definitions/Relationship" - } - ] - }, - "resources": { - "readOnly": true, - "allOf": [ + "$ref": "#/$defs/Time" + }, { - "$ref": "#/definitions/ResourceStore" + "type": "null" } ] }, - "thumbnail": { - "description": "A thumbnail image capturing the visual state at the time of import.\n\nA tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.", - "anyOf": [ - { - "$ref": "#/definitions/ResourceRef" - }, - { - "type": "null" - } - ] - }, - "title": { - "description": "A human-readable title, generally source filename.", - "type": [ - "string", - "null" - ] - }, - "validation_results": { - "description": "Validation results (Ingredient.V3)", - "anyOf": [ - { - "$ref": "#/definitions/ValidationResults" - }, - { - "type": "null" - } - ] - }, - "validation_status": { - "description": "Validation status (Ingredient v1 & v2)", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ValidationStatus" - } - } - } - }, - "IngredientDeltaValidationResult": { - "description": "Represents any changes or deltas between the current and previous validation results for an ingredient's manifest.", - "type": "object", - "required": [ - "ingredientAssertionURI", - "validationDeltas" - ], - "properties": { - "ingredientAssertionURI": { - "description": "JUMBF URI reference to the ingredient assertion", - "type": "string" - }, - "validationDeltas": { - "description": "Validation results for the ingredient's active manifest", - "allOf": [ - { - "$ref": "#/definitions/StatusCodes" - } - ] - } - } - }, - "Item": { - "description": "Description of the boundaries of an identified range.", - "type": "object", - "required": [ - "identifier", - "value" - ], - "properties": { - "identifier": { - "description": "The container-specific term used to identify items, such as \"track_id\" for MP4 or \"item_ID\" for HEIF.", - "type": "string" - }, - "value": { - "description": "The value of the identifier, e.g. a value of \"2\" for an identifier of \"track_id\" would imply track 2 of the asset.", - "type": "string" - } - } - }, - "ManifestAssertionKind": { - "description": "Assertions in C2PA can be stored in several formats", - "type": "string", - "enum": [ - "Cbor", - "Json", - "Binary", - "Uri" - ] - }, - "Range": { - "description": "A spatial, temporal, frame, or textual range describing the region of interest.", - "type": "object", - "required": [ - "type" - ], - "properties": { "frame": { "description": "A frame range.", "anyOf": [ { - "$ref": "#/definitions/Frame" - }, - { - "type": "null" - } - ] - }, - "item": { - "description": "A item identifier.", - "anyOf": [ - { - "$ref": "#/definitions/Item" - }, - { - "type": "null" - } - ] - }, - "shape": { - "description": "A spatial range.", - "anyOf": [ - { - "$ref": "#/definitions/Shape" + "$ref": "#/$defs/Frame" }, { "type": "null" @@ -663,33 +508,28 @@ "description": "A textual range.", "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/$defs/Text" }, { "type": "null" } ] }, - "time": { - "description": "A temporal range.", + "item": { + "description": "A item identifier.", "anyOf": [ { - "$ref": "#/definitions/Time" + "$ref": "#/$defs/Item" }, { "type": "null" } ] - }, - "type": { - "description": "The type of range of interest.", - "allOf": [ - { - "$ref": "#/definitions/RangeType" - } - ] } - } + }, + "required": [ + "type" + ] }, "RangeType": { "description": "The type of range for the region of interest.", @@ -697,229 +537,284 @@ { "description": "A spatial range, see [`Shape`] for more details.", "type": "string", - "enum": [ - "spatial" - ] + "const": "spatial" }, { "description": "A temporal range, see [`Time`] for more details.", "type": "string", - "enum": [ - "temporal" - ] + "const": "temporal" }, { "description": "A spatial range, see [`Frame`] for more details.", "type": "string", - "enum": [ - "frame" - ] + "const": "frame" }, { "description": "A textual range, see [`Text`] for more details.", "type": "string", - "enum": [ - "textual" - ] + "const": "textual" }, { "description": "A range identified by a specific identifier and value, see [`Item`] for more details.", "type": "string", - "enum": [ - "identified" - ] + "const": "identified" } ] }, - "RegionOfInterest": { - "description": "A region of interest within an asset describing the change.\n\nThis struct can be used from [`Action::changes`][crate::assertions::Action::changes], [`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or [`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].", + "Shape": { + "description": "A spatial range representing rectangle, circle, or a polygon.", "type": "object", - "required": [ - "region" - ], "properties": { - "description": { - "description": "A free-text string.", + "type": { + "description": "The type of shape.", + "$ref": "#/$defs/ShapeType" + }, + "unit": { + "description": "The type of unit for the shape range.", + "$ref": "#/$defs/UnitType" + }, + "origin": { + "description": "THe origin of the coordinate in the shape.", + "$ref": "#/$defs/Coordinate" + }, + "width": { + "description": "The width for rectangles or diameter for circles.\n\nThis field can be ignored for polygons.", "type": [ - "string", + "number", "null" - ] + ], + "format": "double" }, - "identifier": { - "description": "A free-text string representing a machine-readable, unique to this assertion, identifier for the region.", + "height": { + "description": "The height of a rectnagle.\n\nThis field can be ignored for circles and polygons.", "type": [ - "string", + "number", "null" - ] - }, - "metadata": { - "description": "Additional information about the asset.", - "anyOf": [ - { - "$ref": "#/definitions/AssertionMetadata" - }, - { - "type": "null" - } - ] + ], + "format": "double" }, - "name": { - "description": "A free-text string representing a human-readable name for the region which might be used in a user interface.", + "inside": { + "description": "If the range is inside the shape.\n\nThe default value is true.", "type": [ - "string", + "boolean", "null" ] }, - "region": { - "description": "A range describing the region of interest for the specific asset.", - "type": "array", - "items": { - "$ref": "#/definitions/Range" - } - }, - "role": { - "description": "A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents the role of a region among other regions.", - "anyOf": [ - { - "$ref": "#/definitions/Role" - }, - { - "type": "null" - } - ] - }, - "type": { - "description": "A value from a controlled vocabulary such as or an entity-specific value (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.\n\nNote this field serializes/deserializes into the name `type`.", + "vertices": { + "description": "The vertices of the polygon.\n\nThis field can be ignored for rectangles and circles.", "type": [ - "string", + "array", "null" - ] + ], + "items": { + "$ref": "#/$defs/Coordinate" + } } - } + }, + "required": [ + "type", + "unit", + "origin" + ] }, - "Relationship": { - "description": "The relationship of the ingredient to the current asset.", + "ShapeType": { + "description": "The type of shape for the range.", "oneOf": [ { - "description": "The current asset is derived from this ingredient.", + "description": "A rectangle.", "type": "string", - "enum": [ - "parentOf" - ] + "const": "rectangle" }, { - "description": "The current asset is a part of this ingredient.", + "description": "A circle.", "type": "string", - "enum": [ - "componentOf" - ] + "const": "circle" }, { - "description": "The ingredient was used as an input to a computational process to create or modify the asset.", + "description": "A polygon.", "type": "string", - "enum": [ - "inputTo" - ] + "const": "polygon" } ] }, - "ResourceRef": { - "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", + "UnitType": { + "description": "The type of unit for the range.", + "oneOf": [ + { + "description": "Use pixels.", + "type": "string", + "const": "pixel" + }, + { + "description": "Use percentage.", + "type": "string", + "const": "percent" + } + ] + }, + "Coordinate": { + "description": "An x, y coordinate used for specifying vertices in polygons.", "type": "object", - "required": [ - "format", - "identifier" - ], "properties": { - "alg": { - "description": "The algorithm used to hash the resource (if applicable).", - "type": [ - "string", - "null" - ] + "x": { + "description": "The coordinate along the x-axis.", + "type": "number", + "format": "double" }, - "data_types": { - "description": "More detailed data types as defined in the C2PA spec.", + "y": { + "description": "The coordinate along the y-axis.", + "type": "number", + "format": "double" + } + }, + "required": [ + "x", + "y" + ] + }, + "Time": { + "description": "A temporal range representing a starting time to an ending time.", + "type": "object", + "properties": { + "type": { + "description": "The type of time.", + "$ref": "#/$defs/TimeType", + "default": "npt" + }, + "start": { + "description": "The start time or the start of the asset if not present.", "type": [ - "array", + "string", "null" - ], - "items": { - "$ref": "#/definitions/AssetType" - } - }, - "format": { - "description": "The mime type of the referenced resource.", - "type": "string" + ] }, - "hash": { - "description": "The hash of the resource (if applicable).", + "end": { + "description": "The end time or the end of the asset if not present.", "type": [ "string", "null" ] - }, - "identifier": { - "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string. Relative JUMBF URIs will be resolved with the manifest label. Relative file paths will be resolved with the base path if provided.", - "type": "string" } } }, - "ResourceStore": { - "description": "Resource store to contain binary objects referenced from JSON serializable structures", + "TimeType": { + "description": "The type of time.", + "oneOf": [ + { + "description": "Times are described using Normal Play Time (npt) as described in RFC 2326.", + "type": "string", + "const": "npt" + } + ] + }, + "Frame": { + "description": "A frame range representing starting and ending frames or pages.\n\nIf both `start` and `end` are missing, the frame will span the entire asset.", "type": "object", - "required": [ - "resources" - ], "properties": { - "base_path": { + "start": { + "description": "The start of the frame or the end of the asset if not present.\n\nThe first frame/page starts at 0.", "type": [ - "string", + "integer", "null" - ] + ], + "format": "int32" }, - "label": { + "end": { + "description": "The end of the frame inclusive or the end of the asset if not present.", "type": [ - "string", + "integer", "null" - ] - }, - "resources": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - } + ], + "format": "int32" } } }, - "ReviewRating": { - "description": "A rating on an Assertion.\n\nSee .", + "Text": { + "description": "A textual range representing multiple (possibly discontinuous) ranges of text.", "type": "object", + "properties": { + "selectors": { + "description": "The ranges of text to select.", + "type": "array", + "items": { + "$ref": "#/$defs/TextSelectorRange" + } + } + }, "required": [ - "explanation", - "value" - ], + "selectors" + ] + }, + "TextSelectorRange": { + "description": "One or two [`TextSelector`][TextSelector] identifiying the range to select.", + "type": "object", "properties": { - "code": { + "selector": { + "description": "The start (or entire) text range.", + "$ref": "#/$defs/TextSelector" + }, + "end": { + "description": "The end of the text range.", + "anyOf": [ + { + "$ref": "#/$defs/TextSelector" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "selector" + ] + }, + "TextSelector": { + "description": "Selects a range of text via a fragment identifier.\n\nThis is modeled after the W3C Web Annotation selector model.", + "type": "object", + "properties": { + "fragment": { + "description": "Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.", + "type": "string" + }, + "start": { + "description": "The start character offset or the start of the fragment if not present.", "type": [ - "string", + "integer", "null" - ] + ], + "format": "int32" }, - "explanation": { + "end": { + "description": "The end character offset or the end of the fragment if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + } + }, + "required": [ + "fragment" + ] + }, + "Item": { + "description": "Description of the boundaries of an identified range.", + "type": "object", + "properties": { + "identifier": { + "description": "The container-specific term used to identify items, such as \"track_id\" for MP4 or \"item_ID\" for HEIF.", "type": "string" }, "value": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 + "description": "The value of the identifier, e.g. a value of \"2\" for an identifier of \"track_id\" would imply track 2 of the asset.", + "type": "string" } - } + }, + "required": [ + "identifier", + "value" + ] }, "Role": { "description": "A role describing the region.", @@ -927,342 +822,275 @@ { "description": "Arbitrary area worth identifying.", "type": "string", - "enum": [ - "c2pa.areaOfInterest" - ] + "const": "c2pa.areaOfInterest" }, { "description": "This area is all that is left after a crop action.", "type": "string", - "enum": [ - "c2pa.cropped" - ] + "const": "c2pa.cropped" }, { "description": "This area has had edits applied to it.", "type": "string", - "enum": [ - "c2pa.edited" - ] + "const": "c2pa.edited" }, { "description": "The area where an ingredient was placed/added.", "type": "string", - "enum": [ - "c2pa.placed" - ] + "const": "c2pa.placed" }, { "description": "Something in this area was redacted.", "type": "string", - "enum": [ - "c2pa.redacted" - ] + "const": "c2pa.redacted" }, { "description": "Area specific to a subject (human or not).", "type": "string", - "enum": [ - "c2pa.subjectArea" - ] + "const": "c2pa.subjectArea" }, { "description": "A range of information was removed/deleted.", "type": "string", - "enum": [ - "c2pa.deleted" - ] + "const": "c2pa.deleted" }, { "description": "Styling was applied to this area.", "type": "string", - "enum": [ - "c2pa.styled" - ] + "const": "c2pa.styled" }, { "description": "Invisible watermarking was applied to this area for the purpose of soft binding.", "type": "string", - "enum": [ - "c2pa.watermarked" - ] + "const": "c2pa.watermarked" } ] }, - "Shape": { - "description": "A spatial range representing rectangle, circle, or a polygon.", + "Ingredient": { + "description": "An `Ingredient` is any external asset that has been used in the creation of an asset.", "type": "object", - "required": [ - "origin", - "type", - "unit" - ], "properties": { - "height": { - "description": "The height of a rectnagle.\n\nThis field can be ignored for circles and polygons.", + "title": { + "description": "A human-readable title, generally source filename.", "type": [ - "number", + "string", "null" - ], - "format": "double" + ] }, - "inside": { - "description": "If the range is inside the shape.\n\nThe default value is true.", + "format": { + "description": "The format of the source file as a MIME type.", "type": [ - "boolean", + "string", "null" ] }, - "origin": { - "description": "THe origin of the coordinate in the shape.", - "allOf": [ - { - "$ref": "#/definitions/Coordinate" - } + "document_id": { + "description": "Document ID from `xmpMM:DocumentID` in XMP metadata.", + "type": [ + "string", + "null" ] }, - "type": { - "description": "The type of shape.", - "allOf": [ - { - "$ref": "#/definitions/ShapeType" - } + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "type": [ + "string", + "null" ] }, - "unit": { - "description": "The type of unit for the shape range.", - "allOf": [ + "provenance": { + "description": "URI from `dcterms:provenance` in XMP metadata.", + "type": [ + "string", + "null" + ] + }, + "thumbnail": { + "description": "A thumbnail image capturing the visual state at the time of import.\n\nA tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, { - "$ref": "#/definitions/UnitType" + "type": "null" } ] }, - "vertices": { - "description": "The vertices of the polygon.\n\nThis field can be ignored for rectangles and circles.", + "hash": { + "description": "An optional hash of the asset to prevent duplicates.", "type": [ - "array", + "string", "null" - ], - "items": { - "$ref": "#/definitions/Coordinate" - } + ] }, - "width": { - "description": "The width for rectangles or diameter for circles.\n\nThis field can be ignored for polygons.", + "relationship": { + "description": "Set to `ParentOf` if this is the parent ingredient.\n\nThere can only be one parent ingredient in the ingredients.", + "$ref": "#/$defs/Relationship", + "default": "componentOf" + }, + "active_manifest": { + "description": "The active manifest label (if one exists).\n\nIf this ingredient has a [`ManifestStore`],\nthis will hold the label of the active [`Manifest`].\n\n[`Manifest`]: crate::Manifest\n[`ManifestStore`]: crate::ManifestStore", "type": [ - "number", + "string", "null" - ], - "format": "double" - } - } - }, - "ShapeType": { - "description": "The type of shape for the range.", - "oneOf": [ - { - "description": "A rectangle.", - "type": "string", - "enum": [ - "rectangle" - ] - }, - { - "description": "A circle.", - "type": "string", - "enum": [ - "circle" ] }, - { - "description": "A polygon.", - "type": "string", - "enum": [ - "polygon" - ] - } - ] - }, - "StatusCodes": { - "description": "Contains a set of success, informational, and failure validation status codes.", - "type": "object", - "required": [ - "failure", - "informational", - "success" - ], - "properties": { - "failure": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - }, - "informational": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - }, - "success": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - } - } - }, - "Text": { - "description": "A textual range representing multiple (possibly discontinuous) ranges of text.", - "type": "object", - "required": [ - "selectors" - ], - "properties": { - "selectors": { - "description": "The ranges of text to select.", - "type": "array", - "items": { - "$ref": "#/definitions/TextSelectorRange" - } - } - } - }, - "TextSelector": { - "description": "Selects a range of text via a fragment identifier.\n\nThis is modeled after the W3C Web Annotation selector model.", - "type": "object", - "required": [ - "fragment" - ], - "properties": { - "end": { - "description": "The end character offset or the end of the fragment if not present.", + "validation_status": { + "description": "Validation status (Ingredient v1 & v2)", "type": [ - "integer", + "array", "null" ], - "format": "int32" - }, - "fragment": { - "description": "Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.", - "type": "string" + "items": { + "$ref": "#/$defs/ValidationStatus" + } }, - "start": { - "description": "The start character offset or the start of the fragment if not present.", - "type": [ - "integer", - "null" - ], - "format": "int32" - } - } - }, - "TextSelectorRange": { - "description": "One or two [`TextSelector`][TextSelector] identifiying the range to select.", - "type": "object", - "required": [ - "selector" - ], - "properties": { - "end": { - "description": "The end of the text range.", + "validation_results": { + "description": "Validation results (Ingredient.V3)", "anyOf": [ { - "$ref": "#/definitions/TextSelector" + "$ref": "#/$defs/ValidationResults" }, { "type": "null" } ] }, - "selector": { - "description": "The start (or entire) text range.", - "allOf": [ + "data": { + "description": "A reference to the actual data of the ingredient.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, { - "$ref": "#/definitions/TextSelector" + "type": "null" } ] - } - } - }, - "Time": { - "description": "A temporal range representing a starting time to an ending time.", - "type": "object", - "properties": { - "end": { - "description": "The end time or the end of the asset if not present.", + }, + "description": { + "description": "Additional description of the ingredient.", "type": [ "string", "null" ] }, - "start": { - "description": "The start time or the start of the asset if not present.", + "informational_URI": { + "description": "URI to an informational page about the ingredient or its data.", "type": [ "string", "null" ] }, - "type": { - "description": "The type of time.", - "default": "npt", - "allOf": [ + "metadata": { + "description": "Any additional [`Metadata`] as defined in the C2PA spec.\n\n[`Metadata`]: crate::Metadata", + "anyOf": [ { - "$ref": "#/definitions/TimeType" + "$ref": "#/$defs/AssertionMetadata" + }, + { + "type": "null" } ] + }, + "data_types": { + "description": "Additional information about the data's type to the ingredient V2 structure.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssetType" + } + }, + "manifest_data": { + "description": "A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.\n\n[`ManifestStore`]: crate::ManifestStore", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "label": { + "description": "The ingredient's label as assigned in the manifest.", + "type": [ + "string", + "null" + ] + }, + "ocsp_responses": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ResourceRef" + } } } }, - "TimeType": { - "description": "The type of time.", + "Relationship": { + "description": "The relationship of the ingredient to the current asset.", "oneOf": [ { - "description": "Times are described using Normal Play Time (npt) as described in RFC 2326.", + "description": "The current asset is derived from this ingredient.", "type": "string", - "enum": [ - "npt" - ] - } - ] - }, - "UnitType": { - "description": "The type of unit for the range.", - "oneOf": [ + "const": "parentOf" + }, { - "description": "Use pixels.", + "description": "The current asset is a part of this ingredient.", "type": "string", - "enum": [ - "pixel" - ] + "const": "componentOf" }, { - "description": "Use percentage.", + "description": "The ingredient was used as an input to a computational process to create or modify the asset.", "type": "string", - "enum": [ - "percent" - ] + "const": "inputTo" } ] }, - "UriOrResource": { - "anyOf": [ - { - "$ref": "#/definitions/ResourceRef" + "ValidationStatus": { + "description": "A `ValidationStatus` struct describes the validation status of a\nspecific part of a manifest.\n\nSee .", + "type": "object", + "properties": { + "code": { + "type": "string" }, - { - "$ref": "#/definitions/HashedUri" + "url": { + "type": [ + "string", + "null" + ] + }, + "explanation": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": [ + "boolean", + "null" + ], + "writeOnly": true } + }, + "required": [ + "code" ] }, "ValidationResults": { - "description": "A map of validation results for a manifest store.\n\nThe map contains the validation results for the active manifest and any ingredient deltas. It is normal for there to be many", + "description": "A map of validation results for a manifest store.\n\nThe map contains the validation results for the active manifest and any ingredient deltas.\nIt is normal for there to be many", "type": "object", "properties": { "activeManifest": { + "description": "Validation status codes for the ingredient's active manifest. Present if ingredient is a C2PA\nasset. Not present if the ingredient is not a C2PA asset.", "anyOf": [ { - "$ref": "#/definitions/StatusCodes" + "$ref": "#/$defs/StatusCodes" }, { "type": "null" @@ -1270,46 +1098,114 @@ ] }, "ingredientDeltas": { + "description": "List of any changes/deltas between the current and previous validation results for each ingredient's\nmanifest. Present if the the ingredient is a C2PA asset.", "type": [ "array", "null" ], "items": { - "$ref": "#/definitions/IngredientDeltaValidationResult" + "$ref": "#/$defs/IngredientDeltaValidationResult" } } } }, - "ValidationStatus": { - "description": "A `ValidationStatus` struct describes the validation status of a specific part of a manifest.\n\nSee .", + "StatusCodes": { + "description": "Contains a set of success, informational, and failure validation status codes.", + "type": "object", + "properties": { + "success": { + "description": "An array of validation success codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + }, + "informational": { + "description": "An array of validation informational codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + }, + "failure": { + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } + } + }, + "required": [ + "success", + "informational", + "failure" + ] + }, + "IngredientDeltaValidationResult": { + "description": "Represents any changes or deltas between the current and previous validation results for an ingredient's manifest.", "type": "object", + "properties": { + "ingredientAssertionURI": { + "description": "JUMBF URI reference to the ingredient assertion", + "type": "string" + }, + "validationDeltas": { + "description": "Validation results for the ingredient's active manifest", + "$ref": "#/$defs/StatusCodes" + } + }, "required": [ - "code" - ], + "ingredientAssertionURI", + "validationDeltas" + ] + }, + "AssertionDefinition": { + "description": "Defines an assertion that consists of a label that can be either\na C2PA-defined assertion label or a custom label in reverse domain format.", + "type": "object", "properties": { - "code": { + "label": { + "description": "An assertion label in reverse domain format", "type": "string" }, - "explanation": { - "type": [ - "string", - "null" - ] + "data": { + "description": "The assertion data", + "$ref": "#/$defs/AssertionData" }, - "success": { - "writeOnly": true, - "type": [ - "boolean", - "null" + "kind": { + "description": "The kind of assertion data, either Cbor or Json (defaults to Cbor)", + "anyOf": [ + { + "$ref": "#/$defs/ManifestAssertionKind" + }, + { + "type": "null" + } ] }, - "url": { - "type": [ - "string", - "null" - ] + "created": { + "description": "True if this assertion is attributed to the signer (defaults to false)", + "type": "boolean" } - } + }, + "required": [ + "label", + "data" + ] + }, + "AssertionData": { + "description": "This allows the assertion to be expressed as CBOR or JSON.\nThe default is CBOR unless you specify that an assertion should be JSON.", + "anyOf": [ + true + ] + }, + "ManifestAssertionKind": { + "description": "Assertions in C2PA can be stored in several formats", + "type": "string", + "enum": [ + "Cbor", + "Json", + "Binary", + "Uri" + ] } } } \ No newline at end of file diff --git a/_data/Reader_schema.json b/_data/Reader_schema.json index 85b9027..ef83065 100644 --- a/_data/Reader_schema.json +++ b/_data/Reader_schema.json @@ -1,11 +1,8 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Reader", "description": "Use a Reader to read and validate a manifest store.", "type": "object", - "required": [ - "manifests" - ], "properties": { "active_manifest": { "description": "A label for the active (most recent) manifest in the store", @@ -18,14 +15,24 @@ "description": "A HashMap of Manifests", "type": "object", "additionalProperties": { - "$ref": "#/definitions/Manifest" + "$ref": "#/$defs/Manifest" + } + }, + "validation_status": { + "description": "ValidationStatus generated when loading the ManifestStore from an asset", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ValidationStatus" } }, "validation_results": { "description": "ValidationStatus generated when loading the ManifestStore from an asset", "anyOf": [ { - "$ref": "#/definitions/ValidationResults" + "$ref": "#/$defs/ValidationResults" }, { "type": "null" @@ -36,259 +43,256 @@ "description": "The validation state of the manifest store", "anyOf": [ { - "$ref": "#/definitions/ValidationState" + "$ref": "#/$defs/ValidationState" }, { "type": "null" } ] - }, - "validation_status": { - "description": "ValidationStatus generated when loading the ManifestStore from an asset", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ValidationStatus" - } } }, - "definitions": { - "Actor": { - "description": "Identifies a person responsible for an action.", + "required": [ + "manifests" + ], + "$defs": { + "Manifest": { + "description": "A Manifest represents all the information in a c2pa manifest", "type": "object", "properties": { - "credentials": { - "description": "List of references to W3C Verifiable Credentials.", + "vendor": { + "description": "Optional prefix added to the generated Manifest label.\nThis is typically an internet domain name for the vendor (i.e. `adobe`).", + "type": [ + "string", + "null" + ] + }, + "claim_generator": { + "description": "A User Agent formatted string identifying the software/hardware/system produced this claim\nSpaces are not allowed in names, versions can be specified with product/1.0 syntax.", + "type": [ + "string", + "null" + ] + }, + "claim_generator_info": { + "description": "A list of claim generator info data identifying the software/hardware/system produced this claim.", "type": [ "array", "null" ], "items": { - "$ref": "#/definitions/HashedUri" + "$ref": "#/$defs/ClaimGeneratorInfo" } }, - "identifier": { - "description": "An identifier for a human actor, used when the \"type\" is `humanEntry.identified`.", + "metadata": { + "description": "A list of user metadata for this claim.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssertionMetadata" + } + }, + "title": { + "description": "A human-readable title, generally source filename.", "type": [ "string", "null" ] - } - } - }, - "AssertionMetadata": { - "description": "The AssertionMetadata structure can be used as part of other assertions or on its own to reference others", - "type": "object", - "properties": { - "dataSource": { - "anyOf": [ - { - "$ref": "#/definitions/DataSource" - }, - { - "type": "null" - } + }, + "format": { + "description": "The format of the source file as a MIME type.", + "type": [ + "string", + "null" ] }, - "dateTime": { + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "type": "string", + "default": "xmp:iid:0928bb7a-c6b5-498f-b41f-e8935be61d44" + }, + "thumbnail": { "anyOf": [ { - "$ref": "#/definitions/DateT" + "$ref": "#/$defs/ResourceRef" }, { "type": "null" } ] }, - "localizations": { + "ingredients": { + "description": "A List of ingredients", + "type": "array", + "items": { + "$ref": "#/$defs/Ingredient" + }, + "default": [] + }, + "credentials": { + "description": "A List of verified credentials", + "type": [ + "array", + "null" + ], + "items": true + }, + "assertions": { + "description": "A list of assertions", + "type": "array", + "items": { + "$ref": "#/$defs/ManifestAssertion" + }, + "default": [] + }, + "redactions": { + "description": "A list of redactions - URIs to a redacted assertions", "type": [ "array", "null" ], "items": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } + "type": "string" } }, - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/HashedUri" - }, - { - "type": "null" - } - ] - }, - "regionOfInterest": { + "signature_info": { + "description": "Signature data (only used for reporting)", "anyOf": [ { - "$ref": "#/definitions/RegionOfInterest" + "$ref": "#/$defs/SignatureInfo" }, { "type": "null" } ] }, - "reviewRatings": { + "label": { "type": [ - "array", + "string", "null" - ], - "items": { - "$ref": "#/definitions/ReviewRating" - } + ] } } }, - "AssetType": { + "ClaimGeneratorInfo": { + "description": "Description of the claim generator, or the software used in generating the claim.\n\nThis structure is also used for actions softwareAgent", "type": "object", - "required": [ - "type" - ], "properties": { - "type": { + "name": { + "description": "A human readable string naming the claim_generator", "type": "string" }, "version": { + "description": "A human readable string of the product's version", "type": [ "string", "null" ] - } - } - }, - "ClaimGeneratorInfo": { - "description": "Description of the claim generator, or the software used in generating the claim.\n\nThis structure is also used for actions softwareAgent", - "type": "object", - "required": [ - "name" - ], - "properties": { + }, "icon": { "description": "hashed URI to the icon (either embedded or remote)", "anyOf": [ { - "$ref": "#/definitions/UriOrResource" + "$ref": "#/$defs/UriOrResource" }, { "type": "null" } ] }, - "name": { - "description": "A human readable string naming the claim_generator", - "type": "string" - }, "operating_system": { "description": "A human readable string of the OS the claim generator is running on", "type": [ "string", "null" ] - }, - "version": { - "description": "A human readable string of the product's version", - "type": [ - "string", - "null" - ] } }, - "additionalProperties": true - }, - "Coordinate": { - "description": "An x, y coordinate used for specifying vertices in polygons.", - "type": "object", "required": [ - "x", - "y" + "name" ], - "properties": { - "x": { - "description": "The coordinate along the x-axis.", - "type": "number", - "format": "double" + "additionalProperties": true + }, + "UriOrResource": { + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" }, - "y": { - "description": "The coordinate along the y-axis.", - "type": "number", - "format": "double" + { + "$ref": "#/$defs/HashedUri" } - } + ] }, - "DataSource": { - "description": "A description of the source for assertion data", + "ResourceRef": { + "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", "type": "object", - "required": [ - "type" - ], "properties": { - "actors": { - "description": "A list of [`Actor`]s associated with this source.", + "format": { + "description": "The mime type of the referenced resource.", + "type": "string" + }, + "identifier": { + "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string.\nRelative JUMBF URIs will be resolved with the manifest label.\nRelative file paths will be resolved with the base path if provided.", + "type": "string" + }, + "data_types": { + "description": "More detailed data types as defined in the C2PA spec.", "type": [ "array", "null" ], "items": { - "$ref": "#/definitions/Actor" + "$ref": "#/$defs/AssetType" } }, - "details": { - "description": "A human-readable string giving details about the source of the assertion data.", + "alg": { + "description": "The algorithm used to hash the resource (if applicable).", "type": [ "string", "null" ] }, - "type": { - "description": "A value from among the enumerated list indicating the source of the assertion.", - "type": "string" + "hash": { + "description": "The hash of the resource (if applicable).", + "type": [ + "string", + "null" + ] } - } - }, - "DateT": { - "type": "string" + }, + "required": [ + "format", + "identifier" + ] }, - "Frame": { - "description": "A frame range representing starting and ending frames or pages.\n\nIf both `start` and `end` are missing, the frame will span the entire asset.", + "AssetType": { "type": "object", "properties": { - "end": { - "description": "The end of the frame inclusive or the end of the asset if not present.", - "type": [ - "integer", - "null" - ], - "format": "int32" + "type": { + "type": "string" }, - "start": { - "description": "The start of the frame or the end of the asset if not present.\n\nThe first frame/page starts at 0.", + "version": { "type": [ - "integer", + "string", "null" - ], - "format": "int32" + ] } - } + }, + "required": [ + "type" + ] }, "HashedUri": { - "description": "A `HashedUri` provides a reference to content available within the same manifest store.\n\nThis is described in [§8.3, URI References], of the C2PA Technical Specification.\n\n[§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references", + "description": "A `HashedUri` provides a reference to content available within the same\nmanifest store.\n\nThis is described in [§8.3, URI References], of the C2PA Technical\nSpecification.\n\n[§8.3, URI References]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references", "type": "object", - "required": [ - "hash", - "url" - ], "properties": { + "url": { + "description": "JUMBF URI reference", + "type": "string" + }, "alg": { - "description": "A string identifying the cryptographic hash algorithm used to compute the hash", + "description": "A string identifying the cryptographic hash algorithm used to compute\nthe hash", "type": [ "string", "null" @@ -300,221 +304,571 @@ "items": { "type": "integer", "format": "uint8", - "minimum": 0.0 + "minimum": 0, + "maximum": 255 } - }, - "url": { - "description": "JUMBF URI reference", - "type": "string" } - } + }, + "required": [ + "url", + "hash" + ] }, - "Ingredient": { - "description": "An `Ingredient` is any external asset that has been used in the creation of an asset.", + "AssertionMetadata": { + "description": "The AssertionMetadata structure can be used as part of other assertions or on its own to reference others", "type": "object", "properties": { - "active_manifest": { - "description": "The active manifest label (if one exists).\n\nIf this ingredient has a [`ManifestStore`], this will hold the label of the active [`Manifest`].\n\n[`Manifest`]: crate::Manifest [`ManifestStore`]: crate::ManifestStore", + "reviewRatings": { "type": [ - "string", + "array", "null" + ], + "items": { + "$ref": "#/$defs/ReviewRating" + } + }, + "dateTime": { + "anyOf": [ + { + "$ref": "#/$defs/DateT" + }, + { + "type": "null" + } ] }, - "data": { - "description": "A reference to the actual data of the ingredient.", + "reference": { "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/HashedUri" }, { "type": "null" } ] }, - "data_types": { - "description": "Additional information about the data's type to the ingredient V2 structure.", + "dataSource": { + "anyOf": [ + { + "$ref": "#/$defs/DataSource" + }, + { + "type": "null" + } + ] + }, + "localizations": { "type": [ "array", "null" ], "items": { - "$ref": "#/definitions/AssetType" + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } } }, - "description": { - "description": "Additional description of the ingredient.", + "regionOfInterest": { + "anyOf": [ + { + "$ref": "#/$defs/RegionOfInterest" + }, + { + "type": "null" + } + ] + } + } + }, + "ReviewRating": { + "description": "A rating on an Assertion.\n\nSee .", + "type": "object", + "properties": { + "explanation": { + "type": "string" + }, + "code": { "type": [ "string", "null" ] }, - "document_id": { - "description": "Document ID from `xmpMM:DocumentID` in XMP metadata.", + "value": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "explanation", + "value" + ] + }, + "DateT": { + "type": "string" + }, + "DataSource": { + "description": "A description of the source for assertion data", + "type": "object", + "properties": { + "type": { + "description": "A value from among the enumerated list indicating the source of the assertion.", + "type": "string" + }, + "details": { + "description": "A human-readable string giving details about the source of the assertion data.", "type": [ "string", "null" ] }, - "format": { - "description": "The format of the source file as a MIME type.", + "actors": { + "description": "A list of [`Actor`]s associated with this source.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/Actor" + } + } + }, + "required": [ + "type" + ] + }, + "Actor": { + "description": "Identifies a person responsible for an action.", + "type": "object", + "properties": { + "identifier": { + "description": "An identifier for a human actor, used when the \"type\" is `humanEntry.identified`.", "type": [ "string", "null" ] }, - "hash": { - "description": "An optional hash of the asset to prevent duplicates.", + "credentials": { + "description": "List of references to W3C Verifiable Credentials.", "type": [ - "string", + "array", "null" - ] + ], + "items": { + "$ref": "#/$defs/HashedUri" + } + } + } + }, + "RegionOfInterest": { + "description": "A region of interest within an asset describing the change.\n\nThis struct can be used from [`Action::changes`][crate::assertions::Action::changes],\n[`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or\n[`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].", + "type": "object", + "properties": { + "region": { + "description": "A range describing the region of interest for the specific asset.", + "type": "array", + "items": { + "$ref": "#/$defs/Range" + } }, - "informational_URI": { - "description": "URI to an informational page about the ingredient or its data.", + "name": { + "description": "A free-text string representing a human-readable name for the region which might be used in a user interface.", "type": [ "string", "null" ] }, - "instance_id": { - "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", + "identifier": { + "description": "A free-text string representing a machine-readable, unique to this assertion, identifier for the region.", "type": [ "string", "null" ] }, - "label": { - "description": "The ingredient's label as assigned in the manifest.", + "type": { + "description": "A value from a controlled vocabulary such as or an entity-specific\nvalue (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.\n\nNote this field serializes/deserializes into the name `type`.", "type": [ "string", "null" ] }, - "manifest_data": { - "description": "A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.\n\n[`ManifestStore`]: crate::ManifestStore", + "role": { + "description": "A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents\nthe role of a region among other regions.", "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/Role" }, { "type": "null" } ] }, + "description": { + "description": "A free-text string.", + "type": [ + "string", + "null" + ] + }, "metadata": { - "description": "Any additional [`Metadata`] as defined in the C2PA spec.\n\n[`Metadata`]: crate::Metadata", + "description": "Additional information about the asset.", "anyOf": [ { - "$ref": "#/definitions/AssertionMetadata" + "$ref": "#/$defs/AssertionMetadata" }, { "type": "null" } ] + } + }, + "required": [ + "region" + ] + }, + "Range": { + "description": "A spatial, temporal, frame, or textual range describing the region of interest.", + "type": "object", + "properties": { + "type": { + "description": "The type of range of interest.", + "$ref": "#/$defs/RangeType" }, - "ocsp_responses": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ResourceRef" - } - }, - "provenance": { - "description": "URI from `dcterms:provenance` in XMP metadata.", - "type": [ - "string", - "null" - ] - }, - "relationship": { - "description": "Set to `ParentOf` if this is the parent ingredient.\n\nThere can only be one parent ingredient in the ingredients.", - "default": "componentOf", - "allOf": [ + "shape": { + "description": "A spatial range.", + "anyOf": [ + { + "$ref": "#/$defs/Shape" + }, { - "$ref": "#/definitions/Relationship" + "type": "null" } ] }, - "resources": { - "readOnly": true, - "allOf": [ + "time": { + "description": "A temporal range.", + "anyOf": [ + { + "$ref": "#/$defs/Time" + }, { - "$ref": "#/definitions/ResourceStore" + "type": "null" } ] }, - "thumbnail": { - "description": "A thumbnail image capturing the visual state at the time of import.\n\nA tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.", + "frame": { + "description": "A frame range.", "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/Frame" }, { "type": "null" } ] }, - "title": { - "description": "A human-readable title, generally source filename.", - "type": [ - "string", - "null" - ] - }, - "validation_results": { - "description": "Validation results (Ingredient.V3)", + "text": { + "description": "A textual range.", "anyOf": [ { - "$ref": "#/definitions/ValidationResults" + "$ref": "#/$defs/Text" }, { "type": "null" } ] }, - "validation_status": { - "description": "Validation status (Ingredient v1 & v2)", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ValidationStatus" - } - } - } - }, - "IngredientDeltaValidationResult": { - "description": "Represents any changes or deltas between the current and previous validation results for an ingredient's manifest.", - "type": "object", - "required": [ - "ingredientAssertionURI", - "validationDeltas" - ], - "properties": { - "ingredientAssertionURI": { - "description": "JUMBF URI reference to the ingredient assertion", - "type": "string" - }, - "validationDeltas": { - "description": "Validation results for the ingredient's active manifest", - "allOf": [ + "item": { + "description": "A item identifier.", + "anyOf": [ + { + "$ref": "#/$defs/Item" + }, { - "$ref": "#/definitions/StatusCodes" + "type": "null" } ] } - } - }, - "Item": { - "description": "Description of the boundaries of an identified range.", + }, + "required": [ + "type" + ] + }, + "RangeType": { + "description": "The type of range for the region of interest.", + "oneOf": [ + { + "description": "A spatial range, see [`Shape`] for more details.", + "type": "string", + "const": "spatial" + }, + { + "description": "A temporal range, see [`Time`] for more details.", + "type": "string", + "const": "temporal" + }, + { + "description": "A spatial range, see [`Frame`] for more details.", + "type": "string", + "const": "frame" + }, + { + "description": "A textual range, see [`Text`] for more details.", + "type": "string", + "const": "textual" + }, + { + "description": "A range identified by a specific identifier and value, see [`Item`] for more details.", + "type": "string", + "const": "identified" + } + ] + }, + "Shape": { + "description": "A spatial range representing rectangle, circle, or a polygon.", "type": "object", + "properties": { + "type": { + "description": "The type of shape.", + "$ref": "#/$defs/ShapeType" + }, + "unit": { + "description": "The type of unit for the shape range.", + "$ref": "#/$defs/UnitType" + }, + "origin": { + "description": "THe origin of the coordinate in the shape.", + "$ref": "#/$defs/Coordinate" + }, + "width": { + "description": "The width for rectangles or diameter for circles.\n\nThis field can be ignored for polygons.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "height": { + "description": "The height of a rectnagle.\n\nThis field can be ignored for circles and polygons.", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "inside": { + "description": "If the range is inside the shape.\n\nThe default value is true.", + "type": [ + "boolean", + "null" + ] + }, + "vertices": { + "description": "The vertices of the polygon.\n\nThis field can be ignored for rectangles and circles.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/Coordinate" + } + } + }, "required": [ - "identifier", - "value" - ], + "type", + "unit", + "origin" + ] + }, + "ShapeType": { + "description": "The type of shape for the range.", + "oneOf": [ + { + "description": "A rectangle.", + "type": "string", + "const": "rectangle" + }, + { + "description": "A circle.", + "type": "string", + "const": "circle" + }, + { + "description": "A polygon.", + "type": "string", + "const": "polygon" + } + ] + }, + "UnitType": { + "description": "The type of unit for the range.", + "oneOf": [ + { + "description": "Use pixels.", + "type": "string", + "const": "pixel" + }, + { + "description": "Use percentage.", + "type": "string", + "const": "percent" + } + ] + }, + "Coordinate": { + "description": "An x, y coordinate used for specifying vertices in polygons.", + "type": "object", + "properties": { + "x": { + "description": "The coordinate along the x-axis.", + "type": "number", + "format": "double" + }, + "y": { + "description": "The coordinate along the y-axis.", + "type": "number", + "format": "double" + } + }, + "required": [ + "x", + "y" + ] + }, + "Time": { + "description": "A temporal range representing a starting time to an ending time.", + "type": "object", + "properties": { + "type": { + "description": "The type of time.", + "$ref": "#/$defs/TimeType", + "default": "npt" + }, + "start": { + "description": "The start time or the start of the asset if not present.", + "type": [ + "string", + "null" + ] + }, + "end": { + "description": "The end time or the end of the asset if not present.", + "type": [ + "string", + "null" + ] + } + } + }, + "TimeType": { + "description": "The type of time.", + "oneOf": [ + { + "description": "Times are described using Normal Play Time (npt) as described in RFC 2326.", + "type": "string", + "const": "npt" + } + ] + }, + "Frame": { + "description": "A frame range representing starting and ending frames or pages.\n\nIf both `start` and `end` are missing, the frame will span the entire asset.", + "type": "object", + "properties": { + "start": { + "description": "The start of the frame or the end of the asset if not present.\n\nThe first frame/page starts at 0.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "end": { + "description": "The end of the frame inclusive or the end of the asset if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + } + } + }, + "Text": { + "description": "A textual range representing multiple (possibly discontinuous) ranges of text.", + "type": "object", + "properties": { + "selectors": { + "description": "The ranges of text to select.", + "type": "array", + "items": { + "$ref": "#/$defs/TextSelectorRange" + } + } + }, + "required": [ + "selectors" + ] + }, + "TextSelectorRange": { + "description": "One or two [`TextSelector`][TextSelector] identifiying the range to select.", + "type": "object", + "properties": { + "selector": { + "description": "The start (or entire) text range.", + "$ref": "#/$defs/TextSelector" + }, + "end": { + "description": "The end of the text range.", + "anyOf": [ + { + "$ref": "#/$defs/TextSelector" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "selector" + ] + }, + "TextSelector": { + "description": "Selects a range of text via a fragment identifier.\n\nThis is modeled after the W3C Web Annotation selector model.", + "type": "object", + "properties": { + "fragment": { + "description": "Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.", + "type": "string" + }, + "start": { + "description": "The start character offset or the start of the fragment if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "end": { + "description": "The end character offset or the end of the fragment if not present.", + "type": [ + "integer", + "null" + ], + "format": "int32" + } + }, + "required": [ + "fragment" + ] + }, + "Item": { + "description": "Description of the boundaries of an identified range.", + "type": "object", "properties": { "identifier": { "description": "The container-specific term used to identify items, such as \"track_id\" for MP4 or \"item_ID\" for HEIF.", @@ -524,45 +878,73 @@ "description": "The value of the identifier, e.g. a value of \"2\" for an identifier of \"track_id\" would imply track 2 of the asset.", "type": "string" } - } + }, + "required": [ + "identifier", + "value" + ] + }, + "Role": { + "description": "A role describing the region.", + "oneOf": [ + { + "description": "Arbitrary area worth identifying.", + "type": "string", + "const": "c2pa.areaOfInterest" + }, + { + "description": "This area is all that is left after a crop action.", + "type": "string", + "const": "c2pa.cropped" + }, + { + "description": "This area has had edits applied to it.", + "type": "string", + "const": "c2pa.edited" + }, + { + "description": "The area where an ingredient was placed/added.", + "type": "string", + "const": "c2pa.placed" + }, + { + "description": "Something in this area was redacted.", + "type": "string", + "const": "c2pa.redacted" + }, + { + "description": "Area specific to a subject (human or not).", + "type": "string", + "const": "c2pa.subjectArea" + }, + { + "description": "A range of information was removed/deleted.", + "type": "string", + "const": "c2pa.deleted" + }, + { + "description": "Styling was applied to this area.", + "type": "string", + "const": "c2pa.styled" + }, + { + "description": "Invisible watermarking was applied to this area for the purpose of soft binding.", + "type": "string", + "const": "c2pa.watermarked" + } + ] }, - "Manifest": { - "description": "A Manifest represents all the information in a c2pa manifest", + "Ingredient": { + "description": "An `Ingredient` is any external asset that has been used in the creation of an asset.", "type": "object", "properties": { - "assertions": { - "description": "A list of assertions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/ManifestAssertion" - } - }, - "claim_generator": { - "description": "A User Agent formatted string identifying the software/hardware/system produced this claim Spaces are not allowed in names, versions can be specified with product/1.0 syntax.", + "title": { + "description": "A human-readable title, generally source filename.", "type": [ "string", "null" ] }, - "claim_generator_info": { - "description": "A list of claim generator info data identifying the software/hardware/system produced this claim.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ClaimGeneratorInfo" - } - }, - "credentials": { - "description": "A List of verified credentials", - "type": [ - "array", - "null" - ], - "items": true - }, "format": { "description": "The format of the source file as a MIME type.", "type": [ @@ -570,331 +952,150 @@ "null" ] }, - "ingredients": { - "description": "A List of ingredients", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Ingredient" - } - }, - "instance_id": { - "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", - "default": "xmp:iid:b017de99-3d68-40d0-9068-9e1fb309e99f", - "type": "string" - }, - "label": { + "document_id": { + "description": "Document ID from `xmpMM:DocumentID` in XMP metadata.", "type": [ "string", "null" ] }, - "metadata": { - "description": "A list of user metadata for this claim.", + "instance_id": { + "description": "Instance ID from `xmpMM:InstanceID` in XMP metadata.", "type": [ - "array", + "string", "null" - ], - "items": { - "$ref": "#/definitions/AssertionMetadata" - } + ] }, - "redactions": { - "description": "A list of redactions - URIs to a redacted assertions", + "provenance": { + "description": "URI from `dcterms:provenance` in XMP metadata.", "type": [ - "array", + "string", "null" - ], - "items": { - "type": "string" - } - }, - "resources": { - "description": "container for binary assets (like thumbnails)", - "readOnly": true, - "allOf": [ - { - "$ref": "#/definitions/ResourceStore" - } - ] - }, - "signature_info": { - "description": "Signature data (only used for reporting)", - "anyOf": [ - { - "$ref": "#/definitions/SignatureInfo" - }, - { - "type": "null" - } ] }, "thumbnail": { + "description": "A thumbnail image capturing the visual state at the time of import.\n\nA tuple of thumbnail MIME format (for example `image/jpeg`) and binary bits of the image.", "anyOf": [ { - "$ref": "#/definitions/ResourceRef" + "$ref": "#/$defs/ResourceRef" }, { "type": "null" } ] }, - "title": { - "description": "A human-readable title, generally source filename.", + "hash": { + "description": "An optional hash of the asset to prevent duplicates.", "type": [ "string", "null" ] }, - "vendor": { - "description": "Optional prefix added to the generated Manifest label. This is typically an internet domain name for the vendor (i.e. `adobe`).", + "relationship": { + "description": "Set to `ParentOf` if this is the parent ingredient.\n\nThere can only be one parent ingredient in the ingredients.", + "$ref": "#/$defs/Relationship", + "default": "componentOf" + }, + "active_manifest": { + "description": "The active manifest label (if one exists).\n\nIf this ingredient has a [`ManifestStore`],\nthis will hold the label of the active [`Manifest`].\n\n[`Manifest`]: crate::Manifest\n[`ManifestStore`]: crate::ManifestStore", "type": [ "string", "null" ] - } - } - }, - "ManifestAssertion": { - "description": "A labeled container for an Assertion value in a Manifest", - "type": "object", - "required": [ - "data", - "label" - ], - "properties": { - "data": { - "description": "The data of the assertion as Value", - "allOf": [ - { - "$ref": "#/definitions/ManifestData" - } - ] }, - "instance": { - "description": "There can be more than one assertion for any label", + "validation_status": { + "description": "Validation status (Ingredient v1 & v2)", "type": [ - "integer", + "array", "null" ], - "format": "uint", - "minimum": 0.0 - }, - "kind": { - "description": "The [ManifestAssertionKind] for this assertion (as stored in c2pa content)", - "anyOf": [ - { - "$ref": "#/definitions/ManifestAssertionKind" - }, - { - "type": "null" - } - ] - }, - "label": { - "description": "An assertion label in reverse domain format", - "type": "string" - } - } - }, - "ManifestAssertionKind": { - "description": "Assertions in C2PA can be stored in several formats", - "type": "string", - "enum": [ - "Cbor", - "Json", - "Binary", - "Uri" - ] - }, - "ManifestData": { - "anyOf": [ - true, - { - "type": "array", "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 + "$ref": "#/$defs/ValidationStatus" } - } - ] - }, - "Range": { - "description": "A spatial, temporal, frame, or textual range describing the region of interest.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "frame": { - "description": "A frame range.", - "anyOf": [ - { - "$ref": "#/definitions/Frame" - }, - { - "type": "null" - } - ] - }, - "item": { - "description": "A item identifier.", - "anyOf": [ - { - "$ref": "#/definitions/Item" - }, - { - "type": "null" - } - ] - }, - "shape": { - "description": "A spatial range.", - "anyOf": [ - { - "$ref": "#/definitions/Shape" - }, - { - "type": "null" - } - ] }, - "text": { - "description": "A textual range.", + "validation_results": { + "description": "Validation results (Ingredient.V3)", "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/$defs/ValidationResults" }, { "type": "null" } ] }, - "time": { - "description": "A temporal range.", + "data": { + "description": "A reference to the actual data of the ingredient.", "anyOf": [ { - "$ref": "#/definitions/Time" + "$ref": "#/$defs/ResourceRef" }, { "type": "null" } ] }, - "type": { - "description": "The type of range of interest.", - "allOf": [ - { - "$ref": "#/definitions/RangeType" - } - ] - } - } - }, - "RangeType": { - "description": "The type of range for the region of interest.", - "oneOf": [ - { - "description": "A spatial range, see [`Shape`] for more details.", - "type": "string", - "enum": [ - "spatial" - ] - }, - { - "description": "A temporal range, see [`Time`] for more details.", - "type": "string", - "enum": [ - "temporal" - ] - }, - { - "description": "A spatial range, see [`Frame`] for more details.", - "type": "string", - "enum": [ - "frame" - ] - }, - { - "description": "A textual range, see [`Text`] for more details.", - "type": "string", - "enum": [ - "textual" - ] - }, - { - "description": "A range identified by a specific identifier and value, see [`Item`] for more details.", - "type": "string", - "enum": [ - "identified" - ] - } - ] - }, - "RegionOfInterest": { - "description": "A region of interest within an asset describing the change.\n\nThis struct can be used from [`Action::changes`][crate::assertions::Action::changes], [`AssertionMetadata::region_of_interest`][crate::assertions::AssertionMetadata::region_of_interest], or [`SoftBindingScope::region`][crate::assertions::soft_binding::SoftBindingScope::region].", - "type": "object", - "required": [ - "region" - ], - "properties": { "description": { - "description": "A free-text string.", + "description": "Additional description of the ingredient.", "type": [ "string", "null" ] }, - "identifier": { - "description": "A free-text string representing a machine-readable, unique to this assertion, identifier for the region.", + "informational_URI": { + "description": "URI to an informational page about the ingredient or its data.", "type": [ "string", "null" ] }, "metadata": { - "description": "Additional information about the asset.", + "description": "Any additional [`Metadata`] as defined in the C2PA spec.\n\n[`Metadata`]: crate::Metadata", "anyOf": [ { - "$ref": "#/definitions/AssertionMetadata" + "$ref": "#/$defs/AssertionMetadata" }, { "type": "null" } ] }, - "name": { - "description": "A free-text string representing a human-readable name for the region which might be used in a user interface.", + "data_types": { + "description": "Additional information about the data's type to the ingredient V2 structure.", "type": [ - "string", - "null" - ] - }, - "region": { - "description": "A range describing the region of interest for the specific asset.", - "type": "array", + "array", + "null" + ], "items": { - "$ref": "#/definitions/Range" + "$ref": "#/$defs/AssetType" } }, - "role": { - "description": "A value from our controlled vocabulary or an entity-specific value (e.g., com.litware.coolArea) that represents the role of a region among other regions.", + "manifest_data": { + "description": "A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.\n\n[`ManifestStore`]: crate::ManifestStore", "anyOf": [ { - "$ref": "#/definitions/Role" + "$ref": "#/$defs/ResourceRef" }, { "type": "null" } ] }, - "type": { - "description": "A value from a controlled vocabulary such as or an entity-specific value (e.g., com.litware.newType) that represents the type of thing(s) depicted by a region.\n\nNote this field serializes/deserializes into the name `type`.", + "label": { + "description": "The ingredient's label as assigned in the manifest.", "type": [ "string", "null" ] + }, + "ocsp_responses": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ResourceRef" + } } } }, @@ -904,286 +1105,193 @@ { "description": "The current asset is derived from this ingredient.", "type": "string", - "enum": [ - "parentOf" - ] + "const": "parentOf" }, { "description": "The current asset is a part of this ingredient.", "type": "string", - "enum": [ - "componentOf" - ] + "const": "componentOf" }, { "description": "The ingredient was used as an input to a computational process to create or modify the asset.", "type": "string", - "enum": [ - "inputTo" - ] + "const": "inputTo" } ] }, - "ResourceRef": { - "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", + "ValidationStatus": { + "description": "A `ValidationStatus` struct describes the validation status of a\nspecific part of a manifest.\n\nSee .", "type": "object", - "required": [ - "format", - "identifier" - ], "properties": { - "alg": { - "description": "The algorithm used to hash the resource (if applicable).", + "code": { + "type": "string" + }, + "url": { "type": [ "string", "null" ] }, - "data_types": { - "description": "More detailed data types as defined in the C2PA spec.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/AssetType" - } - }, - "format": { - "description": "The mime type of the referenced resource.", - "type": "string" - }, - "hash": { - "description": "The hash of the resource (if applicable).", + "explanation": { "type": [ "string", "null" ] }, - "identifier": { - "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string. Relative JUMBF URIs will be resolved with the manifest label. Relative file paths will be resolved with the base path if provided.", - "type": "string" + "success": { + "type": [ + "boolean", + "null" + ], + "writeOnly": true } - } + }, + "required": [ + "code" + ] }, - "ResourceStore": { - "description": "Resource store to contain binary objects referenced from JSON serializable structures", + "ValidationResults": { + "description": "A map of validation results for a manifest store.\n\nThe map contains the validation results for the active manifest and any ingredient deltas.\nIt is normal for there to be many", "type": "object", - "required": [ - "resources" - ], "properties": { - "base_path": { - "type": [ - "string", - "null" + "activeManifest": { + "description": "Validation status codes for the ingredient's active manifest. Present if ingredient is a C2PA\nasset. Not present if the ingredient is not a C2PA asset.", + "anyOf": [ + { + "$ref": "#/$defs/StatusCodes" + }, + { + "type": "null" + } ] }, - "label": { + "ingredientDeltas": { + "description": "List of any changes/deltas between the current and previous validation results for each ingredient's\nmanifest. Present if the the ingredient is a C2PA asset.", "type": [ - "string", + "array", "null" - ] - }, - "resources": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } + ], + "items": { + "$ref": "#/$defs/IngredientDeltaValidationResult" } } } }, - "ReviewRating": { - "description": "A rating on an Assertion.\n\nSee .", + "StatusCodes": { + "description": "Contains a set of success, informational, and failure validation status codes.", "type": "object", - "required": [ - "explanation", - "value" - ], "properties": { - "code": { - "type": [ - "string", - "null" - ] + "success": { + "description": "An array of validation success codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } }, - "explanation": { - "type": "string" + "informational": { + "description": "An array of validation informational codes. May be empty.", + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } }, - "value": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 + "failure": { + "type": "array", + "items": { + "$ref": "#/$defs/ValidationStatus" + } } - } + }, + "required": [ + "success", + "informational", + "failure" + ] }, - "Role": { - "description": "A role describing the region.", - "oneOf": [ - { - "description": "Arbitrary area worth identifying.", - "type": "string", - "enum": [ - "c2pa.areaOfInterest" - ] - }, - { - "description": "This area is all that is left after a crop action.", - "type": "string", - "enum": [ - "c2pa.cropped" - ] - }, - { - "description": "This area has had edits applied to it.", - "type": "string", - "enum": [ - "c2pa.edited" - ] - }, - { - "description": "The area where an ingredient was placed/added.", - "type": "string", - "enum": [ - "c2pa.placed" - ] - }, - { - "description": "Something in this area was redacted.", - "type": "string", - "enum": [ - "c2pa.redacted" - ] - }, - { - "description": "Area specific to a subject (human or not).", - "type": "string", - "enum": [ - "c2pa.subjectArea" - ] - }, - { - "description": "A range of information was removed/deleted.", - "type": "string", - "enum": [ - "c2pa.deleted" - ] - }, - { - "description": "Styling was applied to this area.", - "type": "string", - "enum": [ - "c2pa.styled" - ] + "IngredientDeltaValidationResult": { + "description": "Represents any changes or deltas between the current and previous validation results for an ingredient's manifest.", + "type": "object", + "properties": { + "ingredientAssertionURI": { + "description": "JUMBF URI reference to the ingredient assertion", + "type": "string" }, - { - "description": "Invisible watermarking was applied to this area for the purpose of soft binding.", - "type": "string", - "enum": [ - "c2pa.watermarked" - ] + "validationDeltas": { + "description": "Validation results for the ingredient's active manifest", + "$ref": "#/$defs/StatusCodes" } + }, + "required": [ + "ingredientAssertionURI", + "validationDeltas" ] }, - "Shape": { - "description": "A spatial range representing rectangle, circle, or a polygon.", + "ManifestAssertion": { + "description": "A labeled container for an Assertion value in a Manifest", "type": "object", - "required": [ - "origin", - "type", - "unit" - ], "properties": { - "height": { - "description": "The height of a rectnagle.\n\nThis field can be ignored for circles and polygons.", - "type": [ - "number", - "null" - ], - "format": "double" + "label": { + "description": "An assertion label in reverse domain format", + "type": "string" }, - "inside": { - "description": "If the range is inside the shape.\n\nThe default value is true.", + "data": { + "description": "The data of the assertion as Value", + "$ref": "#/$defs/ManifestData" + }, + "instance": { + "description": "There can be more than one assertion for any label", "type": [ - "boolean", + "integer", "null" - ] - }, - "origin": { - "description": "THe origin of the coordinate in the shape.", - "allOf": [ - { - "$ref": "#/definitions/Coordinate" - } - ] + ], + "format": "uint", + "minimum": 0 }, - "type": { - "description": "The type of shape.", - "allOf": [ + "kind": { + "description": "The [ManifestAssertionKind] for this assertion (as stored in c2pa content)", + "anyOf": [ { - "$ref": "#/definitions/ShapeType" - } - ] - }, - "unit": { - "description": "The type of unit for the shape range.", - "allOf": [ + "$ref": "#/$defs/ManifestAssertionKind" + }, { - "$ref": "#/definitions/UnitType" + "type": "null" } ] }, - "vertices": { - "description": "The vertices of the polygon.\n\nThis field can be ignored for rectangles and circles.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Coordinate" - } - }, - "width": { - "description": "The width for rectangles or diameter for circles.\n\nThis field can be ignored for polygons.", - "type": [ - "number", - "null" - ], - "format": "double" + "created": { + "description": "True if this assertion is attributed to the signer\nThis maps to a created vs a gathered assertion. (defaults to false)", + "type": "boolean" } - } - }, - "ShapeType": { - "description": "The type of shape for the range.", - "oneOf": [ - { - "description": "A rectangle.", - "type": "string", - "enum": [ - "rectangle" - ] - }, - { - "description": "A circle.", - "type": "string", - "enum": [ - "circle" - ] - }, + }, + "required": [ + "label", + "data" + ] + }, + "ManifestData": { + "anyOf": [ + true, { - "description": "A polygon.", - "type": "string", - "enum": [ - "polygon" - ] + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0, + "maximum": 255 + } } ] }, + "ManifestAssertionKind": { + "description": "Assertions in C2PA can be stored in several formats", + "type": "string", + "enum": [ + "Cbor", + "Json", + "Binary", + "Uri" + ] + }, "SignatureInfo": { "description": "Holds information about a signature", "type": "object", @@ -1192,15 +1300,15 @@ "description": "Human-readable issuing authority for this signature.", "anyOf": [ { - "$ref": "#/definitions/SigningAlg" + "$ref": "#/$defs/SigningAlg" }, { "type": "null" } ] }, - "cert_serial_number": { - "description": "The serial number of the certificate.", + "issuer": { + "description": "Human-readable issuing authority for this signature.", "type": [ "string", "null" @@ -1213,336 +1321,88 @@ "null" ] }, - "issuer": { - "description": "Human-readable issuing authority for this signature.", + "cert_serial_number": { + "description": "The serial number of the certificate.", "type": [ "string", "null" ] }, - "revocation_status": { - "description": "Revocation status of the certificate.", + "time": { + "description": "The time the signature was created.", "type": [ - "boolean", + "string", "null" ] }, - "time": { - "description": "The time the signature was created.", + "revocation_status": { + "description": "Revocation status of the certificate.", "type": [ - "string", + "boolean", "null" ] } } }, "SigningAlg": { - "description": "Describes the digital signature algorithms allowed by the C2PA spec.\n\nPer [§13.2, “Digital Signatures”]:\n\n> All digital signatures applied as per the technical requirements of this > specification shall be generated using one of the digital signature > algorithms and key types listed as described in this section.\n\n[§13.2, “Digital Signatures”]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_digital_signatures", + "description": "Describes the digital signature algorithms allowed by the C2PA spec.\n\nPer [§13.2, “Digital Signatures”]:\n\n> All digital signatures applied as per the technical requirements of this\n> specification shall be generated using one of the digital signature\n> algorithms and key types listed as described in this section.\n\n[§13.2, “Digital Signatures”]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_digital_signatures", "oneOf": [ { "description": "ECDSA with SHA-256", "type": "string", - "enum": [ - "Es256" - ] + "const": "Es256" }, { "description": "ECDSA with SHA-384", "type": "string", - "enum": [ - "Es384" - ] + "const": "Es384" }, { "description": "ECDSA with SHA-512", "type": "string", - "enum": [ - "Es512" - ] + "const": "Es512" }, { "description": "RSASSA-PSS using SHA-256 and MGF1 with SHA-256", "type": "string", - "enum": [ - "Ps256" - ] + "const": "Ps256" }, { "description": "RSASSA-PSS using SHA-384 and MGF1 with SHA-384", "type": "string", - "enum": [ - "Ps384" - ] + "const": "Ps384" }, { "description": "RSASSA-PSS using SHA-512 and MGF1 with SHA-512", "type": "string", - "enum": [ - "Ps512" - ] + "const": "Ps512" }, { "description": "Edwards-Curve DSA (Ed25519 instance only)", "type": "string", - "enum": [ - "Ed25519" - ] - } - ] - }, - "StatusCodes": { - "description": "Contains a set of success, informational, and failure validation status codes.", - "type": "object", - "required": [ - "failure", - "informational", - "success" - ], - "properties": { - "failure": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - }, - "informational": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - }, - "success": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidationStatus" - } - } - } - }, - "Text": { - "description": "A textual range representing multiple (possibly discontinuous) ranges of text.", - "type": "object", - "required": [ - "selectors" - ], - "properties": { - "selectors": { - "description": "The ranges of text to select.", - "type": "array", - "items": { - "$ref": "#/definitions/TextSelectorRange" - } - } - } - }, - "TextSelector": { - "description": "Selects a range of text via a fragment identifier.\n\nThis is modeled after the W3C Web Annotation selector model.", - "type": "object", - "required": [ - "fragment" - ], - "properties": { - "end": { - "description": "The end character offset or the end of the fragment if not present.", - "type": [ - "integer", - "null" - ], - "format": "int32" - }, - "fragment": { - "description": "Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.", - "type": "string" - }, - "start": { - "description": "The start character offset or the start of the fragment if not present.", - "type": [ - "integer", - "null" - ], - "format": "int32" - } - } - }, - "TextSelectorRange": { - "description": "One or two [`TextSelector`][TextSelector] identifiying the range to select.", - "type": "object", - "required": [ - "selector" - ], - "properties": { - "end": { - "description": "The end of the text range.", - "anyOf": [ - { - "$ref": "#/definitions/TextSelector" - }, - { - "type": "null" - } - ] - }, - "selector": { - "description": "The start (or entire) text range.", - "allOf": [ - { - "$ref": "#/definitions/TextSelector" - } - ] - } - } - }, - "Time": { - "description": "A temporal range representing a starting time to an ending time.", - "type": "object", - "properties": { - "end": { - "description": "The end time or the end of the asset if not present.", - "type": [ - "string", - "null" - ] - }, - "start": { - "description": "The start time or the start of the asset if not present.", - "type": [ - "string", - "null" - ] - }, - "type": { - "description": "The type of time.", - "default": "npt", - "allOf": [ - { - "$ref": "#/definitions/TimeType" - } - ] - } - } - }, - "TimeType": { - "description": "The type of time.", - "oneOf": [ - { - "description": "Times are described using Normal Play Time (npt) as described in RFC 2326.", - "type": "string", - "enum": [ - "npt" - ] - } - ] - }, - "UnitType": { - "description": "The type of unit for the range.", - "oneOf": [ - { - "description": "Use pixels.", - "type": "string", - "enum": [ - "pixel" - ] - }, - { - "description": "Use percentage.", - "type": "string", - "enum": [ - "percent" - ] - } - ] - }, - "UriOrResource": { - "anyOf": [ - { - "$ref": "#/definitions/ResourceRef" - }, - { - "$ref": "#/definitions/HashedUri" + "const": "Ed25519" } ] }, - "ValidationResults": { - "description": "A map of validation results for a manifest store.\n\nThe map contains the validation results for the active manifest and any ingredient deltas. It is normal for there to be many", - "type": "object", - "properties": { - "activeManifest": { - "anyOf": [ - { - "$ref": "#/definitions/StatusCodes" - }, - { - "type": "null" - } - ] - }, - "ingredientDeltas": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/IngredientDeltaValidationResult" - } - } - } - }, "ValidationState": { - "description": "Indicates if the manifest store is valid and trusted.\n\nThe Trusted state implies the manifest store is valid and the active signature is trusted.", + "description": "Represents the levels of assurance a manifest store achives when evaluated against the C2PA\nspecifications structural, cryptographic, and trust requirements.\n\nSee [§14.3. Validation states].\n\n[§14.3. Validation states]: https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_validation_states", "oneOf": [ { - "description": "Errors were found in the manifest store.", + "description": "The manifest store fails to meet [ValidationState::WellFormed] requirements, meaning it cannot\neven be parsed or its basic structure is non-compliant.\n\nThis case may also occur if validation is disabled in the SDK.", "type": "string", - "enum": [ - "Invalid" - ] + "const": "Invalid" }, { - "description": "No errors were found in validation, but the active signature is not trusted.", + "description": "The manifest store is well-formed and the cryptographic integrity checks succeed.\n\nSee [§14.3.5. Valid Manifest].\n\n[§14.3.5. Valid Manifest]: https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_valid_manifest", "type": "string", - "enum": [ - "Valid" - ] + "const": "Valid" }, { - "description": "The manifest store is valid and the active signature is trusted.", + "description": "The manifest store is valid and signed by a certificate that chains up to a trusted root or known\nauthority in the trust list.\n\nSee [§14.3.6. Trusted Manifest].\n\n[§14.3.6. Trusted Manifest]: https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_trusted_manifest", "type": "string", - "enum": [ - "Trusted" - ] + "const": "Trusted" } ] - }, - "ValidationStatus": { - "description": "A `ValidationStatus` struct describes the validation status of a specific part of a manifest.\n\nSee .", - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string" - }, - "explanation": { - "type": [ - "string", - "null" - ] - }, - "success": { - "writeOnly": true, - "type": [ - "boolean", - "null" - ] - }, - "url": { - "type": [ - "string", - "null" - ] - } - } } } } \ No newline at end of file diff --git a/_data/Settings_schema.json b/_data/Settings_schema.json index af4d8d3..73ffb7d 100644 --- a/_data/Settings_schema.json +++ b/_data/Settings_schema.json @@ -1,137 +1,895 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Settings", + "description": "Settings for configuring all aspects of c2pa-rs.\n\n[Settings::default] will be set thread-locally by default. Any settings set via\n[Settings::from_toml] or [Settings::from_file] will also be thread-local.", "type": "object", - "required": [ - "builder", - "core", - "trust", - "verify" - ], "properties": { - "builder": { - "$ref": "#/definitions/Builder" - }, - "core": { - "$ref": "#/definitions/Core" + "version": { + "description": "Version of the configuration.", + "type": "integer", + "format": "uint32", + "minimum": 0 }, "trust": { - "$ref": "#/definitions/Trust" + "description": "Settings for configuring the C2PA trust lists.", + "$ref": "#/$defs/Trust" + }, + "cawg_trust": { + "description": "Settings for configuring the CAWG trust lists.", + "$ref": "#/$defs/Trust" + }, + "core": { + "description": "Settings for configuring core features.", + "$ref": "#/$defs/Core" }, "verify": { - "$ref": "#/definitions/Verify" + "description": "Settings for configuring verification.", + "$ref": "#/$defs/Verify" + }, + "builder": { + "description": "Settings for configuring the [`Builder`].\n\n[`Builder`]: crate::Builder", + "$ref": "#/$defs/BuilderSettings" + }, + "signer": { + "description": "Settings for configuring the base C2PA signer, accessible via [`Settings::signer`].", + "anyOf": [ + { + "$ref": "#/$defs/SignerSettings" + }, + { + "type": "null" + } + ] + }, + "cawg_x509_signer": { + "description": "Settings for configuring the CAWG x509 signer, accessible via [`Settings::signer`].", + "anyOf": [ + { + "$ref": "#/$defs/SignerSettings" + }, + { + "type": "null" + } + ] } }, - "definitions": { - "Builder": { + "required": [ + "version", + "trust", + "cawg_trust", + "core", + "verify", + "builder" + ], + "$defs": { + "Trust": { + "description": "Settings to configure the trust list.", "type": "object", - "required": [ - "auto_thumbnail" - ], "properties": { - "auto_thumbnail": { + "verify_trust_list": { + "description": "Whether to verify certificates against the trust lists specified in [`Trust`]. This\noption is ONLY applicable to CAWG.\n\nThe default value is true.\n\n
\nVerifying trust is REQUIRED by the CAWG spec. This option should only be used for development or testing.\n
", "type": "boolean" + }, + "user_anchors": { + "description": "List of additional user-provided trust anchor root certificates as a PEM bundle.", + "type": [ + "string", + "null" + ] + }, + "trust_anchors": { + "description": "List of default trust anchor root certificates as a PEM bundle.\n\nNormally this option contains the official C2PA-recognized trust anchors found here:\n", + "type": [ + "string", + "null" + ] + }, + "trust_config": { + "description": "List of allowed extended key usage (EKU) object identifiers (OID) that\ncertificates must have.", + "type": [ + "string", + "null" + ] + }, + "allowed_list": { + "description": "List of explicitly allowed certificates as a PEM bundle.", + "type": [ + "string", + "null" + ] } - } + }, + "required": [ + "verify_trust_list" + ] }, "Core": { + "description": "Settings to configure core features.", "type": "object", + "properties": { + "merkle_tree_chunk_size_in_kb": { + "description": "Size of the [`BmffHash`] merkle tree chunks in kilobytes.\n\nThis option is associated with the [`MerkleMap::fixed_block_size`] field.\n\nSee more information in the spec here:\n\n\n[`MerkleMap::fixed_block_size`]: crate::assertions::MerkleMap::fixed_block_size\n[`BmffHash`]: crate::assertions::BmffHash", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0 + }, + "merkle_tree_max_proofs": { + "description": "Maximum number of proofs when validating or writing a [`BmffHash`] merkle tree.\n\nThis option defaults to 5.\n\nSee more information in the spec here:\n\n\n[`BmffHash`]: crate::assertions::BmffHash", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "backing_store_memory_threshold_in_mb": { + "description": "Maximum amount of data in megabytes that will be loaded into memory before\nbeing stored in temporary files on the disk.\n\nThis option defaults to 512MB and can result in noticeable performance improvements.", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "decode_identity_assertions": { + "description": "Whether to decode CAWG [`IdentityAssertion`]s during reading in the [`Reader`].\n\nThis option defaults to true.\n\n[`IdentityAssertion`]: crate::identity::IdentityAssertion\n[`Reader`]: crate::Reader", + "type": "boolean" + } + }, "required": [ - "compress_manifests", - "debug", - "hash_alg", - "prefer_bmff_merkle_tree", - "prefer_box_hash", - "salt_jumbf_boxes" - ], + "merkle_tree_max_proofs", + "backing_store_memory_threshold_in_mb", + "decode_identity_assertions" + ] + }, + "Verify": { + "description": "Settings to configure the verification process.", + "type": "object", "properties": { - "compress_manifests": { + "verify_after_reading": { + "description": "Whether to verify the manifest after reading in the [`Reader`].\n\nThe default value is true.\n\n
\nDisabling validation can improve reading performance, BUT it carries the risk of reading an invalid\nmanifest.\n
\n\n[`Reader`]: crate::Reader", "type": "boolean" }, - "debug": { + "verify_after_sign": { + "description": "Whether to verify the manifest after signing in the [`Builder`].\n\nThe default value is true.\n\n
\nDisabling validation can improve signing performance, BUT it carries the risk of signing an invalid\nmanifest.\n
\n\n[`Builder`]: crate::Builder", "type": "boolean" }, - "hash_alg": { - "type": "string" + "verify_trust": { + "description": "Whether to verify certificates against the trust lists specified in [`Trust`]. To configure\ntimestamp certificate verification, see [`Verify::verify_timestamp_trust`].\n\nThe default value is true.\n\n
\nVerifying trust is REQUIRED by the C2PA spec. This option should only be used for development or testing.\n
", + "type": "boolean" }, - "max_memory_usage": { - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0.0 + "verify_timestamp_trust": { + "description": "Whether to verify the timestamp certificates against the trust lists specified in [`Trust`].\n\nThe default value is true.\n\n
\nVerifying timestamp trust is REQUIRED by the C2PA spec. This option should only be used for development or testing.\n
", + "type": "boolean" }, - "prefer_bmff_merkle_tree": { + "ocsp_fetch": { + "description": "Whether to fetch the certificates OCSP status during validation.\n\nRevocation status is checked in the following order:\n1. The OCSP staple stored in the COSE claim of the manifest\n2. Otherwise if `ocsp_fetch` is enabled, it fetches a new OCSP status\n3. Otherwise if `ocsp_fetch` is disabled, it checks `CertificateStatus` assertions\n\nThe default value is false.", "type": "boolean" }, - "prefer_box_hash": { + "remote_manifest_fetch": { + "description": "Whether to fetch remote manifests in the following scenarios:\n- Constructing a [`Reader`]\n- Constructing an [`Ingredient`]\n- Adding an [`Ingredient`] to the [`Builder`]\n\nThe default value is true.\n\n
\nThis setting is only applicable if the crate is compiled with the `fetch_remote_manifests` feature.\n
\n\n[`Reader`]: crate::Reader\n[`Ingredient`]: crate::Ingredient\n[`Builder`]: crate::Builder", "type": "boolean" }, - "salt_jumbf_boxes": { + "check_ingredient_trust": { + "description": "Whether to verify ingredient certificates against the trust lists specific in [`Trust`].\n\nThe default value is true.", + "type": "boolean" + }, + "skip_ingredient_conflict_resolution": { + "description": "Whether to skip ingredient conflict resolution when multiple ingredients have the same\nmanifest identifier. This settings is only applicable for C2PA v2 validation.\n\nThe default value is false.\n\nSee more information in the spec here:\n", + "type": "boolean" + }, + "strict_v1_validation": { + "description": "Whether to do strictly C2PA v1 validation or otherwise the latest validation.\n\nThe default value is false.", "type": "boolean" } - } + }, + "required": [ + "verify_after_reading", + "verify_after_sign", + "verify_trust", + "verify_timestamp_trust", + "ocsp_fetch", + "remote_manifest_fetch", + "check_ingredient_trust", + "skip_ingredient_conflict_resolution", + "strict_v1_validation" + ] }, - "Trust": { + "BuilderSettings": { + "description": "Settings for the [Builder][crate::Builder].", "type": "object", "properties": { - "allowed_list": { + "claim_generator_info": { + "description": "Claim generator info that is automatically added to the builder.\n\nNote that this information will prepend any claim generator info\nprovided explicitly to the builder.", + "anyOf": [ + { + "$ref": "#/$defs/ClaimGeneratorInfoSettings" + }, + { + "type": "null" + } + ] + }, + "thumbnail": { + "description": "Various settings for configuring automatic thumbnail generation.", + "$ref": "#/$defs/ThumbnailSettings" + }, + "actions": { + "description": "Settings for configuring fields in an [Actions][crate::assertions::Actions] assertion.\n\nFor more information on the reasoning behind this field see [ActionsSettings].", + "$ref": "#/$defs/ActionsSettings" + }, + "certificate_status_fetch": { + "description": "Whether to create [`CertificateStatus`] assertions for manifests to store certificate revocation\nstatus. The assertion can be fetched for the active manifest or for all manifests (including\ningredients).\n\nThe default is to not fetch them at all.\n\nSee more information in the spec here:\n\n\n[`CertificateStatus`]: crate::assertions::CertificateStatus", + "anyOf": [ + { + "$ref": "#/$defs/OcspFetchScope" + }, + { + "type": "null" + } + ] + }, + "certificate_status_should_override": { + "description": "Whether to only use [`CertificateStatus`] assertions to check certificate revocation status. If there\nis a stapled OCSP in the COSE claim of the manifest, it will be ignored. If [`Verify::ocsp_fetch`] is\nenabled, it will also be ignored.\n\nThe default value is false.\n\n[`CertificateStatus`]: crate::assertions::CertificateStatus\n[`Verify::ocsp_fetch`]: crate::settings::Verify::ocsp_fetch", "type": [ - "string", + "boolean", + "null" + ] + }, + "intent": { + "description": "The default [`BuilderIntent`] for the [`Builder`].\n\nSee [`BuilderIntent`] for more information.\n\n[`BuilderIntent`]: crate::BuilderIntent\n[`Builder`]: crate::Builder", + "anyOf": [ + { + "$ref": "#/$defs/BuilderIntent" + }, + { + "type": "null" + } + ] + }, + "created_assertion_labels": { + "description": "Assertions with a base label included in this list will be automatically marked as a created assertion.\nAssertions not in this list will be automatically marked as gathered.\n\nNote that the label should be a **base label**, not including the assertion version nor instance.\n\nSee more information on the difference between created vs gathered assertions in the spec here:\n", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "generate_c2pa_archive": { + "description": "Whether to generate a C2PA archive (instead of zip) when writing the manifest builder.\nThis will eventually become the default behavior.", + "type": [ + "boolean", "null" ] + } + }, + "required": [ + "thumbnail", + "actions" + ] + }, + "ClaimGeneratorInfoSettings": { + "description": "Settings for the claim generator info.", + "type": "object", + "properties": { + "name": { + "description": "A human readable string naming the claim_generator.", + "type": "string" }, - "private_anchors": { + "version": { + "description": "A human readable string of the product's version.", "type": [ "string", "null" ] }, - "trust_anchors": { + "icon": { + "description": "Reference to an icon.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "operating_system": { + "description": "Settings for the claim generator info's operating system field.", + "anyOf": [ + { + "$ref": "#/$defs/ClaimGeneratorInfoOperatingSystem" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": true + }, + "ResourceRef": { + "description": "A reference to a resource to be used in JSON serialization.\n\nThe underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].", + "type": "object", + "properties": { + "format": { + "description": "The mime type of the referenced resource.", + "type": "string" + }, + "identifier": { + "description": "A URI that identifies the resource as referenced from the manifest.\n\nThis may be a JUMBF URI, a file path, a URL or any other string.\nRelative JUMBF URIs will be resolved with the manifest label.\nRelative file paths will be resolved with the base path if provided.", + "type": "string" + }, + "data_types": { + "description": "More detailed data types as defined in the C2PA spec.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AssetType" + } + }, + "alg": { + "description": "The algorithm used to hash the resource (if applicable).", "type": [ "string", "null" ] }, - "trust_config": { + "hash": { + "description": "The hash of the resource (if applicable).", "type": [ "string", "null" ] } - } + }, + "required": [ + "format", + "identifier" + ] }, - "Verify": { + "AssetType": { "type": "object", + "properties": { + "type": { + "type": "string" + }, + "version": { + "type": [ + "string", + "null" + ] + } + }, "required": [ - "check_ingredient_trust", - "ocsp_fetch", - "remote_manifest_fetch", - "verify_after_reading", - "verify_after_sign", - "verify_trust" - ], + "type" + ] + }, + "ClaimGeneratorInfoOperatingSystem": { + "anyOf": [ + { + "description": "Whether or not to automatically infer the operating system.\n\nThis option will attempt to following the [LLVM \"triples\"] conventions. For more information,\nsee [`ClaimGeneratorInfoOperatingSystem::Other`].\n\n[LLVM \"triples\"]: https://clang.llvm.org/docs/CrossCompilation.html#target-triple", + "type": "null" + }, + { + "description": "The name of the operating system.\n\nIt is recommended to follow the [LLVM \"triples\"] conventions to define the operating system,\nwith the format `---`. For instance:\n- `x86_64-unknown-linux-gnu`\n- `x86_64-pc-windows-msvc`\n- `arm64-apple-darwin`\n\n[LLVM \"triples\"]: https://clang.llvm.org/docs/CrossCompilation.html#target-triple", + "type": "string" + } + ] + }, + "ThumbnailSettings": { + "description": "Settings for controlling automatic thumbnail generation.", + "type": "object", "properties": { - "check_ingredient_trust": { + "enabled": { + "description": "Whether or not to automatically generate thumbnails.\n\nThe default value is true.\n\n
\nThis setting is only applicable if the crate is compiled with the `add_thumbnails` feature.\n
", "type": "boolean" }, - "ocsp_fetch": { + "ignore_errors": { + "description": "Whether to ignore thumbnail generation errors.\n\nThis may occur, for instance, if the thumbnail media type or color layout isn't\nsupported.\n\nThe default value is true.", "type": "boolean" }, - "remote_manifest_fetch": { - "type": "boolean" + "long_edge": { + "description": "The size of the longest edge of the thumbnail.\n\nThis function will resize the input to preserve aspect ratio.\n\nThe default value is 1024.", + "type": "integer", + "format": "uint32", + "minimum": 0 }, - "verify_after_reading": { - "type": "boolean" + "format": { + "description": "Format of the thumbnail.\n\nIf this field isn't specified, the thumbnail format will correspond to the\ninput format.\n\nThe default value is None.", + "anyOf": [ + { + "$ref": "#/$defs/ThumbnailFormat" + }, + { + "type": "null" + } + ] }, - "verify_after_sign": { + "prefer_smallest_format": { + "description": "Whether or not to prefer a smaller sized media format for the thumbnail.\n\nNote that [ThumbnailSettings::format] takes precedence over this field. In addition,\nif the output format is unsupported, it will default to the smallest format regardless\nof the value of this field.\n\nFor instance, if the source input type is a PNG, but it doesn't have an alpha channel,\nthe image will be converted to a JPEG of smaller size.\n\nThe default value is true.", "type": "boolean" }, - "verify_trust": { + "quality": { + "description": "The output quality of the thumbnail.\n\nThis setting contains sensible defaults for things like quality, compression, and\nalgorithms for various formats.\n\nThe default value is [`ThumbnailQuality::Medium`].", + "$ref": "#/$defs/ThumbnailQuality" + } + }, + "required": [ + "enabled", + "ignore_errors", + "long_edge", + "prefer_smallest_format", + "quality" + ] + }, + "ThumbnailFormat": { + "description": "Possible output types for automatic thumbnail generation.\n\nThese formats are a combination of types supported in [image-rs](https://docs.rs/image/latest/image/enum.ImageFormat.html)\nand types defined by the [IANA registry media type](https://www.iana.org/assignments/media-types/media-types.xhtml) (as defined in the spec).", + "oneOf": [ + { + "description": "An image in PNG format.", + "type": "string", + "const": "png" + }, + { + "description": "An image in JPEG format.", + "type": "string", + "const": "jpeg" + }, + { + "description": "An image in GIF format.", + "type": "string", + "const": "gif" + }, + { + "description": "An image in WEBP format.", + "type": "string", + "const": "webp" + }, + { + "description": "An image in TIFF format.", + "type": "string", + "const": "tiff" + } + ] + }, + "ThumbnailQuality": { + "description": "Quality of the thumbnail.", + "oneOf": [ + { + "description": "Low quality.", + "type": "string", + "const": "low" + }, + { + "description": "Medium quality.", + "type": "string", + "const": "medium" + }, + { + "description": "High quality.", + "type": "string", + "const": "high" + } + ] + }, + "ActionsSettings": { + "description": "Settings for configuring the \"base\" [Actions][crate::assertions::Actions] assertion.\n\nThe reason this setting exists only for an [Actions][crate::assertions::Actions] assertion\nis because of its mandations and reusable fields.", + "type": "object", + "properties": { + "all_actions_included": { + "description": "Whether or not to set the [Actions::all_actions_included][crate::assertions::Actions::all_actions_included]\nfield.", + "type": [ + "boolean", + "null" + ] + }, + "templates": { + "description": "Templates to be added to the [Actions::templates][crate::assertions::Actions::templates] field.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ActionTemplateSettings" + } + }, + "auto_created_action": { + "description": "Whether to automatically generate a c2pa.created [Action] assertion or error that it doesn't already exist.\n\nFor more information about the mandatory conditions for a c2pa.created action assertion, see here:\n", + "$ref": "#/$defs/AutoActionSettings" + }, + "auto_opened_action": { + "description": "Whether to automatically generate a c2pa.opened [Action] assertion or error that it doesn't already exist.\n\nFor more information about the mandatory conditions for a c2pa.opened action assertion, see here:\n", + "$ref": "#/$defs/AutoActionSettings" + }, + "auto_placed_action": { + "description": "Whether to automatically generate a c2pa.placed [Action] assertion or error that it doesn't already exist.\n\nFor more information about the mandatory conditions for a c2pa.placed action assertion, see:\n", + "$ref": "#/$defs/AutoActionSettings" + } + }, + "required": [ + "auto_created_action", + "auto_opened_action", + "auto_placed_action" + ] + }, + "ActionTemplateSettings": { + "description": "Settings for an action template.", + "type": "object", + "properties": { + "action": { + "description": "The label associated with this action. See ([c2pa_action][crate::assertions::actions::c2pa_action]).", + "type": "string" + }, + "software_agent": { + "description": "The software agent that performed the action.", + "anyOf": [ + { + "$ref": "#/$defs/ClaimGeneratorInfoSettings" + }, + { + "type": "null" + } + ] + }, + "software_agent_index": { + "description": "0-based index into the softwareAgents array", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0 + }, + "source_type": { + "description": "One of the defined URI values at ``", + "anyOf": [ + { + "$ref": "#/$defs/DigitalSourceType" + }, + { + "type": "null" + } + ] + }, + "icon": { + "description": "Reference to an icon.", + "anyOf": [ + { + "$ref": "#/$defs/ResourceRef" + }, + { + "type": "null" + } + ] + }, + "description": { + "description": "Description of the template.", + "type": [ + "string", + "null" + ] + }, + "template_parameters": { + "description": "Additional parameters for the template", + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + }, + "required": [ + "action" + ] + }, + "DigitalSourceType": { + "description": "Description of the source of an asset.\n\nThe full list of possible digital source types are found below:\n\n", + "anyOf": [ + { + "description": "Media whose digital content is effectively empty, such as a blank canvas or zero-length video.", + "type": "string", + "const": "http://c2pa.org/digitalsourcetype/empty" + }, + { + "description": "Data that is the result of algorithmically using a model derived from sampled content and data.\nDiffers from trainedAlgorithmicMedia in that\nthe result isn’t a media type (e.g., image or video) but is a data format (e.g., CSV, pickle).", + "type": "string", + "const": "http://c2pa.org/digitalsourcetype/trainedAlgorithmicData" + }, + { + "description": "The media was captured from a real-life source using a digital camera or digital recording device.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture" + }, + { + "description": "The media is the result of capturing multiple frames from a real-life source using a digital camera\nor digital recording device, then automatically merging them into a single frame using digital signal\nprocessing techniques and/or non-generative AI. Includes High Dynamic Range (HDR) processing common in\nsmartphone camera apps.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/computationalCapture" + }, + { + "description": "The media was digitised from a negative on film or other transparent medium.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm" + }, + { + "description": "The media was digitised from a positive on a transparency or other transparent medium.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm" + }, + { + "description": "The media was digitised from a non-transparent medium such as a photographic print.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/print" + }, + { + "description": "Minor augmentation or correction by a human, such as a digitally-retouched photo used in a magazine.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/minorHumanEdits", + "deprecated": true + }, + { + "description": "Augmentation, correction or enhancement by one or more humans using non-generative tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/humanEdits" + }, + { + "description": "Augmentation, correction or enhancement using a Generative AI model, such as with inpainting or\noutpainting operations.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia" + }, + { + "description": "Modification or correction by algorithm without changing the main content of the media, initiated\nor configured by a human, such as sharpening or applying noise reduction.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicallyEnhanced" + }, + { + "description": "The digital image was created by computer software.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage", + "deprecated": true + }, + { + "description": "Media created by a human using digital tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalArt", + "deprecated": true + }, + { + "description": "Media created by a human using non-generative tools.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation" + }, + { + "description": "Digital media representation of data via human programming or creativity.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/dataDrivenMedia" + }, + { + "description": "Digital media created algorithmically using an Artificial Intelligence model trained on captured\ncontent.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia" + }, + { + "description": "Media created purely by an algorithm not based on any sampled training data, e.g. an image created\nby software using a mathematical formula.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicMedia" + }, + { + "description": "A capture of the contents of the screen of a computer or mobile device.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/screenCapture" + }, + { + "description": "Live recording of virtual event based on Generative AI and/or captured elements.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/virtualRecording" + }, + { + "description": "Mix or composite of several elements, any of which may or may not be generative AI.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/composite" + }, + { + "description": "Mix or composite of several elements that are all captures of real life.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeCapture" + }, + { + "description": "Mix or composite of several elements, at least one of which is Generative AI.", + "type": "string", + "const": "http://cv.iptc.org/newscodes/digitalsourcetype/compositeSynthetic" + }, + { + "description": "An unknown digital source type.", + "type": "string" + } + ] + }, + "AutoActionSettings": { + "description": "Settings for the auto actions (e.g. created, opened, placed).", + "type": "object", + "properties": { + "enabled": { + "description": "Whether to enable this auto action or not.", "type": "boolean" + }, + "source_type": { + "description": "The default source type for the auto action.", + "anyOf": [ + { + "$ref": "#/$defs/DigitalSourceType" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "enabled" + ] + }, + "OcspFetchScope": { + "description": "The scope of which manifests to fetch for OCSP.", + "oneOf": [ + { + "description": "Fetch OCSP for all manifests.", + "type": "string", + "const": "all" + }, + { + "description": "Fetch OCSP for the active manifest only.", + "type": "string", + "const": "active" + } + ] + }, + "BuilderIntent": { + "description": "Represents the type of builder flow being used.\n\nThis determines how the builder will be used, such as creating a new asset, opening an existing asset,\nor updating an existing asset.", + "oneOf": [ + { + "description": "This is a new digital creation, a DigitalSourceType is required.\n\nThe Manifest must not have have a parent ingredient.\nA `c2pa.created` action will be added if not provided.", + "type": "object", + "properties": { + "create": { + "$ref": "#/$defs/DigitalSourceType" + } + }, + "required": [ + "create" + ], + "additionalProperties": false + }, + { + "description": "This is an edit of a pre-existing parent asset.\n\nThe Manifest must have a parent ingredient.\nA parent ingredient will be generated from the source stream if not otherwise provided.\nA `c2pa.opened action will be tied to the parent ingredient.", + "type": "string", + "const": "edit" + }, + { + "description": "A restricted version of Edit for non-editorial changes.\n\nThere must be only one ingredient, as a parent.\nNo changes can be made to the hashed content of the parent.\nThere are additional restrictions on the types of changes that can be made.", + "type": "string", + "const": "update" + } + ] + }, + "SignerSettings": { + "description": "Settings for configuring a local or remote [`Signer`].\n\nA [`Signer`] can be obtained by calling the [`signer()`] function.\n\n[`Signer`]: crate::Signer\n[`signer()`]: crate::settings::Settings::signer", + "oneOf": [ + { + "description": "A signer configured locally.", + "type": "object", + "properties": { + "local": { + "type": "object", + "properties": { + "alg": { + "$ref": "#/$defs/SigningAlg" + }, + "sign_cert": { + "type": "string" + }, + "private_key": { + "type": "string" + }, + "tsa_url": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "alg", + "sign_cert", + "private_key" + ] + } + }, + "required": [ + "local" + ], + "additionalProperties": false + }, + { + "description": "A signer configured remotely.", + "type": "object", + "properties": { + "remote": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "alg": { + "$ref": "#/$defs/SigningAlg" + }, + "sign_cert": { + "type": "string" + }, + "tsa_url": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "url", + "alg", + "sign_cert" + ] + } + }, + "required": [ + "remote" + ], + "additionalProperties": false + } + ] + }, + "SigningAlg": { + "description": "Describes the digital signature algorithms allowed by the C2PA spec.\n\nPer [§13.2, “Digital Signatures”]:\n\n> All digital signatures applied as per the technical requirements of this\n> specification shall be generated using one of the digital signature\n> algorithms and key types listed as described in this section.\n\n[§13.2, “Digital Signatures”]: https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_digital_signatures", + "oneOf": [ + { + "description": "ECDSA with SHA-256", + "type": "string", + "const": "Es256" + }, + { + "description": "ECDSA with SHA-384", + "type": "string", + "const": "Es384" + }, + { + "description": "ECDSA with SHA-512", + "type": "string", + "const": "Es512" + }, + { + "description": "RSASSA-PSS using SHA-256 and MGF1 with SHA-256", + "type": "string", + "const": "Ps256" + }, + { + "description": "RSASSA-PSS using SHA-384 and MGF1 with SHA-384", + "type": "string", + "const": "Ps384" + }, + { + "description": "RSASSA-PSS using SHA-512 and MGF1 with SHA-512", + "type": "string", + "const": "Ps512" + }, + { + "description": "Edwards-Curve DSA (Ed25519 instance only)", + "type": "string", + "const": "Ed25519" } - } + ] } } } \ No newline at end of file