You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manifest/reading/validation.md
+11-38Lines changed: 11 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,37 +13,33 @@ In the latest version of the SDK,
13
13
Need a high-level summary of full validation, what we're looking for, etc.
14
14
</div>
15
15
16
-
## Validation errors in manifests
17
-
18
-
When you load an asset, all the manifests in the manifest store are validated and any [failure codes](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) are assigned to the `validation_status` array. Inspect the array to find the validation errors.
19
-
20
16
`Reader` has these validation methods:
21
-
-`validation_state()` returns `ValidationState`, which can be `Invalid`, `Valid` or `Trusted`.
22
-
-`validation_results()` returns `ValidationResults`, which returns `success`, `informational`, and `failure` codes for the active manifest and ingredients. NOTE: `ValidationStatus` is deprecated in favor of `ValidationResults`.
17
+
-`validation_state()` returns `ValidationState` object (`validation_state` in JSON), which can be `Invalid`, `Valid` or `Trusted`.
18
+
-`validation_results()` returns `ValidationResults` (`validation_results` in JSON), which can be `success`, `informational`, and `failure` codes for the active manifest and ingredients.
23
19
24
-
:::tip
25
-
Validation returns ONLY error codes; success is not explicitly indicated. If there are no validation errors, then the manifest won't have the `validation_status` element.
20
+
:::note
21
+
The old `ValidationStatus` and `validation_status` array in previous SDK releases are deprecated in favor of `ValidationResults` / `validation_results` and `ValidationState` / `validation_state`.
26
22
:::
27
23
24
+
## Validation errors in manifests
25
+
26
+
When you load an asset, all the manifests in the manifest store are validated and [result codes](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) are assigned to properties in the `validation_results` object.
27
+
28
28
Manifest validation errors can occur, for example, when:
29
29
30
30
- The bits of an asset are edited after it was signed.
31
31
- A claim or assertion is missing or tampered with.
32
32
- The manifest is signed with an invalid credential.
33
33
34
-
:::caution
35
-
Don't assume that just because you didn't get an error from the function return value that there are not validation errors. You MUST check the `validation_status` array to see if there are errors or not.
36
-
:::
37
-
38
34
## Validation errors in ingredients
39
35
40
-
Ingredients are validated when they are imported into an asset and the result is stored in the ingredient's `validation_status` array.
36
+
Ingredients are validated when they are imported into an asset and the result is stored in the ingredient's `validation_results` object.
41
37
42
-
Only errors that are not already recorded in the `validation_status` of an ingredient are reported. See [ValidationStatus](../json-ref/manifest-def.mdx#validationstatus) object in Manifest store reference.
38
+
Only errors that are not already recorded in the `validation_results` of an ingredient are reported. See [ValidationStatus](../json-ref/manifest-def.mdx#validationresults) object in Manifest store reference.
43
39
44
40
## Error status codes
45
41
46
-
The following table describes some common validation error status codes. Refer to the [C2PA Technical Specification](https://c2pa.org/specifications/specification2.2/specs/C2PA_Specification.html#_failure_codes) for the full list.
42
+
The following table describes some common validation error status codes. Refer to the [C2PA Technical Specification](https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) for the full list.
47
43
48
44
| Validation Status Code| Description | Type of URI |
@@ -64,26 +60,3 @@ Validation error status codes can contain JUMBF URIs that reference assertions o
64
60
-**Signature Box URI**: A URI like `self#jumbf=c2pa.signature`.
65
61
66
62
For more information, see the [C2PA Technical Specification](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_uri_references).
67
-
68
-
<!--
69
-
Actions and assertions:
70
-
71
-
For actions - reference the spec e.g. common actions we refer to
0 commit comments