Release notes
Refer to the CHANGELOG for detailed changes derived from Git commit history.
Version 0.79.4
Deprecation of thread-local settings APIs
Release 0.79.4 deprecates all legacy thread-local configuration APIs in favor of explicit Context-based equivalents. These are not breaking changes: All deprecated methods retain their original behavior and continue to work, but will produce compiler warnings.
Rust API
Builder::default() and Reader::default() are now the idiomatic way to construct with default settings, replacing the more verbose Builder::from_context(Context::new()) and Reader::from_context(Context::new()).
The following methods are now deprecated:
| Deprecated | Use instead |
|---|---|
Builder::new() | Builder::default() |
Builder::from_json(json) | Builder::default().with_definition(json) |
Builder::from_archive(stream) | Builder::default().with_archive(stream) |
Reader::from_stream(format, stream) | Reader::default().with_stream(format, stream) |
Reader::from_file(path) | Reader::default().with_file(path) |
Reader::from_manifest_data_and_stream(...) | Reader::default().with_manifest_data_and_stream(...) |
Reader::from_fragmented_files(path, fragments) | Reader::default().with_fragmented_files(path, fragments) |
Settings::from_toml(toml) | Settings::new().with_toml(toml) |
Settings::from_string(str, format) | Settings::new().with_json(str) or Settings::new().with_toml(str) |
Settings::signer() | Configure a signer on a Context and pass it to Builder::from_context |
To use custom settings, create a Context with Context::new().with_settings(...) and pass it to Builder::from_context(context) or Reader::from_context(context).
C FFI
The following C API functions are deprecated:
| Deprecated | Use instead |
|---|---|
c2pa_load_settings | c2pa_settings_new() + c2pa_context_builder_set_settings() |
c2pa_reader_from_stream | c2pa_reader_from_context() |
c2pa_reader_from_file | c2pa_reader_from_context() |
c2pa_reader_from_manifest_data_and_stream | c2pa_reader_from_context() + c2pa_reader_with_manifest_data_and_stream() |
c2pa_builder_from_json | c2pa_builder_from_context() + c2pa_builder_set_definition() |
c2pa_builder_from_archive | c2pa_builder_from_context() + c2pa_builder_with_archive() |
c2pa_signer_from_settings | c2pa_context_builder_set_signer() |
c2pa_read_file, c2pa_read_ingredient_file, c2pa_sign_file | Context-based equivalents |
c2pa_reader_free, c2pa_builder_free, c2pa_string_free, c2pa_manifest_bytes_free, c2pa_signer_free, c2pa_release_string, c2pa_signature_free | c2pa_free() |
C and C++ headers now emit compiler deprecation warnings when deprecated functions are called.
Version 0.77.0
Embeddable API
Release 0.77.0 adds a new embeddable manifest API with Context/Settings, CAWG, and BMFF.v3 support. For details, see Embeddable signing API.
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
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).
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.