Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
138ff74
feat: c2pa-rs and c2pa_c_ffi 0.68.0 update (#189)
tmathern Nov 1, 2025
b272adb
chore: Update c2pa version from v0.68.0 to v0.69.0 (#190)
tmathern Nov 5, 2025
43b460e
fix: Version bump from c2pa-rs and c2pa-c-ffi from v0.69.0 to v0.70.0…
tmathern Nov 6, 2025
e141978
fix: Version bump from c2pa-rs v0.70.0 to v0.71.0 (#193)
tmathern Nov 8, 2025
4ed3ce8
feat: Add set_intent APIs (#194)
tmathern Nov 19, 2025
cc92072
Merge branch 'main' into vNext
tmathern Nov 19, 2025
dde6609
chore: Update c2pa version to v0.72.0 (#198)
tmathern Nov 20, 2025
838639c
chore: Update c2pa version to v0.72.1 (#200)
tmathern Dec 5, 2025
35471a5
chore: Update c2pa version to v0.73.0 (#201)
tmathern Dec 15, 2025
08e64aa
Merge branch 'main' into vNext
tmathern Dec 19, 2025
c10bdc9
Merge branch 'main' into vNext
tmathern Dec 19, 2025
125341a
chore: Update c2pa version to v0.73.1 (#204)
tmathern Dec 20, 2025
8223b74
Merge branch 'main' into vNext
tmathern Dec 27, 2025
3d8387f
chore: Update to native version 0.73.2 (#210)
tmathern Jan 5, 2026
f187bee
fix: Improve typings for errors (#213)
tmathern Jan 7, 2026
a01dd37
feat: Add a factory method to the Reader class (#214)
tmathern Jan 7, 2026
9192996
Merge branch 'main' into vNext
tmathern Jan 7, 2026
99ab6d9
chore: Bump to c2pa-rs v0.74.0 (#215)
tmathern Jan 8, 2026
9f5dd8b
fix: Retrigger tests
tmathern Jan 9, 2026
fb54175
chore: Update c2pa version to v0.75.2
tmathern Jan 15, 2026
9f2c9f6
chore: Update SDK version in unit tests
tmathern Jan 15, 2026
946cc97
Merge branch 'main' into vNext
tmathern Jan 15, 2026
16058b3
fix: export C2paBuilderIntent
tmathern Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ See the [`examples` directory](https://github.com/contentauth/c2pa-python/tree/m

## API reference documentation

See [the section in Contributing to the project](https://github.com/contentauth/c2pa-python/blob/main/docs/project-contributions.md#api-reference-documentation).
Documentation is published at [github.io/c2pa-python/api/c2pa](https://contentauth.github.io/c2pa-python/api/c2pa/index.html).

To build documentation locally, refer to [this section in Contributing to the project](https://github.com/contentauth/c2pa-python/blob/main/docs/project-contributions.md#api-reference-documentation).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion c2pa-native-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2pa-v0.67.1
c2pa-v0.75.2
8 changes: 6 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python example code
# Python example code

The `examples` directory contains some small examples of using the Python library.
The `examples` directory contains some small examples of using this Python library.
The examples use asset files from the `tests/fixtures` directory, save the resulting signed assets to the temporary `output` directory, and display manifest store data and other output to the console.

## Signing and verifying assets
Expand Down Expand Up @@ -102,3 +102,7 @@ In this example, `SignerInfo` creates a `Signer` object that signs the manifest.
```bash
python examples/sign_info.py
```

## Backend application example

[c2pa-python-example](https://github.com/contentauth/c2pa-python-example) is an example of a simple application that accepts an uploaded JPEG image file, attaches a C2PA manifest, and signs it using a certificate. The app uses the CAI Python library and the Flask Python framework to implement a back-end REST endpoint; it does not have an HTML front-end, so you have to use something like curl to access it. This example is a development setup and should not be deployed as-is to a production environment.
10 changes: 6 additions & 4 deletions examples/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
fixtures_dir = os.path.join(os.path.dirname(__file__), "../tests/fixtures/")
output_dir = os.path.join(os.path.dirname(__file__), "../output/")

# Ensure the output directory exists
# Ensure the output directory exists.
if not os.path.exists(output_dir):
os.makedirs(output_dir)

Expand All @@ -43,7 +43,7 @@
with open(fixtures_dir + "es256_private.key", "rb") as key_file:
key = key_file.read()

# Define a callback signer function
# Define a callback signer function.
def callback_signer_es256(data: bytes) -> bytes:
"""Callback function that signs data using ES256 algorithm."""
private_key = serialization.load_pem_private_key(
Expand All @@ -60,7 +60,6 @@ def callback_signer_es256(data: bytes) -> bytes:
# Create a manifest definition as a dictionary.
# This manifest follows the V2 manifest format.
manifest_definition = {
"claim_generator": "python_example",
"claim_generator_info": [{
"name": "python_example",
"version": "0.0.1",
Expand All @@ -87,7 +86,7 @@ def callback_signer_es256(data: bytes) -> bytes:
}

# Sign the image with the signer created above,
# which will use the callback signer
# which will use the callback signer.
print("\nSigning the image file...")

with c2pa.Signer.from_callback(
Expand All @@ -107,6 +106,9 @@ def callback_signer_es256(data: bytes) -> bytes:
print("\nReading signed image metadata:")
with open(output_dir + "A_signed.jpg", "rb") as file:
with c2pa.Reader("image/jpeg", file) as reader:
# The validation state will depend on loaded trust settings.
# Without loaded trust settings,
# the manifest validation_state will be "Invalid".
print(reader.json())

print("\nExample completed successfully!")
Expand Down
3 changes: 3 additions & 0 deletions examples/sign_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
print("\nReading signed image metadata:")
with open(output_dir + "C_signed.jpg", "rb") as file:
with c2pa.Reader("image/jpeg", file) as reader:
# The validation state will depend on loaded trust settings.
# Without loaded trust settings,
# the manifest validation_state will be "Invalid".
print(reader.json())

print("\nExample completed successfully!")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "c2pa-python"
version = "0.27.1"
version = "0.28.0"
requires-python = ">=3.10"
description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library"
readme = { file = "README.md", content-type = "text/markdown" }
Expand Down
4 changes: 4 additions & 0 deletions src/c2pa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
C2paError,
Reader,
C2paSigningAlg,
C2paDigitalSourceType,
C2paBuilderIntent,
C2paSignerInfo,
Signer,
Stream,
Expand All @@ -35,6 +37,8 @@
'C2paError',
'Reader',
'C2paSigningAlg',
'C2paDigitalSourceType',
'C2paBuilderIntent',
'C2paSignerInfo',
'Signer',
'Stream',
Expand Down
Loading
Loading