Release notes
Refer to the CHANGELOG for detailed changes derived from Git commit history.
New API
The current release has a new API that replaces the previous methods of reading and writing C2PA data, which are still supported but will be deprecated. The new API is now the default. Previously, you had to use the unstable_api feature to use it; but this feature is no longer used.
The new API focuses on streaming I/O and supports the following structs:
API Changes for C2PA 2.2
Reader has some new methods:
validation_state()returnsValidationState, which can beInvalid,ValidorTrusted. Use this method instead of checking forvalidation_status() = None.validation_results()returnsValidationResults, which is a more complete form ofValidationStatusand returnssuccess,informational, andfailurecodes for the active manifest and ingredients.ValidationStatusis deprecated in favor ofValidationResults.
Ingredient now supports a validation_results() method and a validation_results field.
An AssetType assertion is now supported.
C2PA v2 claims
NOTE: The library now supports C2PA v2 claims by default. V2 claims have many new checks and status codes. Additionally:
- The
title()andformat()methods of bothManifestandIngredientobjects now return anOption<String>because in v2 claims,titleis optional andformatdoes not exist. - The first
actionmust bec2pa.createdorc2pa.opened(which requires an ingredient).
WARNING: Implementations should not generate deprecated v1 claims. If needed, though, you can generate v1 claims by setting the Builder manifest definition claim_version field to 1.
Using the old API
To use the old deprecated API, enable the v1_api feature; for example:
c2pa = {version="0.45.2", features=["v1_api"]}
This will be the last release with the v1_api feature available.
Language binding support
| Module | Method | C++ | Python | WASM | Node |
|---|---|---|---|---|---|
| Builder | |||||
| new | |||||
| from_json | X | X | X | ||
| set_claim_generator_info | |||||
| set_format | |||||
| set_remote_url | X | ||||
| set_no_embed | X | ||||
| set_thumbnail | |||||
| add_assertion | |||||
| add_assertion_json | |||||
| add_ingredient_from_stream | X | X | |||
| add_ingredient_from_stream_async | |||||
| add_ingredient | |||||
| add_resource | X | X | |||
| to_archive | X | X | |||
| from_archive | X | X | |||
| data_hashed_placeholder | |||||
| sign_data_hashed_embeddable | |||||
| sign_data_hashed_embeddable_async | |||||
| sign_box_hashed_embeddable | |||||
| sign_box_hashed_embeddable_async | |||||
| sign | X | X | |||
| sign_async | |||||
| sign_fragmented_files | |||||
| sign_file | X | X | |||
| Reader | |||||
| from_stream | X | X | |||
| from_stream_async | |||||
| from_file | X | X | |||
| from_file_async | |||||
| from_json | |||||
| from_manifest_data_and_stream | X | X | |||
| from_manifest_data_and_stream_async | |||||
| from_fragment | |||||
| from_fragment_async | |||||
| from_fragmented_files | |||||
| json | |||||
| validation_status | |||||
| active_manifest | X | ||||
| active_label | |||||
| iter_manifests | |||||
| get_manifest | X | ||||
| resource_to_stream | X | X | |||
| to_folder | |||||
| CallbackSigner | |||||
| new | |||||
| set_tsa_url | |||||
| set_context | |||||
| ed25519_sign |