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/usage.md
+79-1Lines changed: 79 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Import the objects needed from the API:
10
10
11
11
```py
12
12
from c2pa import Builder, Reader, Signer, C2paSigningAlg, C2paSignerInfo
13
-
from c2pa import Settings, Context, ContextProvider
13
+
from c2pa import Settings, Context, ContextBuilder, ContextProvider
14
14
```
15
15
16
16
You can use both `Builder`, `Reader` and `Signer` classes with context managers by using a `with` statement.
@@ -122,6 +122,62 @@ except Exception as e:
122
122
123
123
The `Settings` and `Context` classes provide **per-instance configuration** for Reader and Builder operations. This replaces the global `load_settings()` function, which is now deprecated.
`ContextBuilder` provides a fluent interface for constructing a `Context`, matching the c2pa-rs `ContextBuilder` pattern. Use `Context.builder()` to get started.
238
+
239
+
```py
240
+
from c2pa import Context, ContextBuilder, Settings, Signer
When a `Signer` is passed to `Context`, the `Signer` object becomes invalid after this call and must not be reused directly anymore as it became part of the Context. The `Context` takes ownership of the underlying native signer. This allows signing without passing an explicit signer to `Builder.sign()`.
0 commit comments