Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT_NAME = "c2pa-c"
PROJECT_BRIEF = "C++ API for c2pa-c library"
PROJECT_NAME = "c2pa-cpp"
PROJECT_BRIEF = "C++ API for the C2PA SDK"
OUTPUT_DIRECTORY = api-docs/_build
CREATE_SUBDIRS = YES
GENERATE_HTML = YES
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CAI SDK C++ library

The [c2pa-c repository](https://github.com/contentauth/c2pa-c) implements C++ APIs that:
The [c2pa-cpp repository](https://github.com/contentauth/c2pa-cpp) implements C++ APIs that:
- Read and validate C2PA data from media files in supported formats.
- Add signed manifests to media files in supported formats.

Expand Down Expand Up @@ -34,7 +34,7 @@ include(FetchContent)

FetchContent_Declare(
c2pa_cpp
GIT_REPOSITORY https://github.com/contentauth/c2pa-c.git
GIT_REPOSITORY https://github.com/contentauth/c2pa-cpp.git
GIT_TAG main # Or use a specific release tag
)
FetchContent_MakeAvailable(c2pa_cpp)
Expand Down Expand Up @@ -103,7 +103,7 @@ export LD_LIBRARY_PATH="$(pwd)/build/release/tests:$LD_LIBRARY_PATH"

### Testing

Build the [unit tests](https://github.com/contentauth/c2pa-c/tree/main/tests) by entering this `make` command:
Build the [unit tests](https://github.com/contentauth/c2pa-cpp/tree/main/tests) by entering this `make` command:

```
make test
Expand All @@ -115,8 +115,8 @@ API documentation generated by Doxygen is automatically built on each PR.

To generate API docs locally, these are the main files:

- Configuration file: `c2pa-c/Doxyfile`
- Script: `c2pa-c/scripts/generate_api_docs.sh`
- Configuration file: `c2pa-cpp/Doxyfile`
- Script: `c2pa-cpp/scripts/generate_api_docs.sh`
- Output directory: `docs/_build/html`

Install Doxygen if needed:
Expand All @@ -138,10 +138,10 @@ Open `_build/html/index.html` to see the results.

## License

This package is distributed under the terms of both the [MIT license](https://github.com/contentauth/c2pa-c/blob/main/LICENSE-MIT) and the [Apache License (Version 2.0)](https://github.com/contentauth/c2pa-c/blob/main/LICENSE-APACHE).
This package is distributed under the terms of both the [MIT license](https://github.com/contentauth/c2pa-cpp/blob/main/LICENSE-MIT) and the [Apache License (Version 2.0)](https://github.com/contentauth/c2pa-cpp/blob/main/LICENSE-APACHE).

Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.

### Contributions and feedback

We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-c/blob/main/CONTRIBUTING.md).
We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see [Contributing](https://github.com/contentauth/c2pa-cpp/blob/main/CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions ci-cd/amalgam-build.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# c2pa-c amalgam build
# c2pa-cpp amalgam build

## Overview

Expand Down Expand Up @@ -160,7 +160,7 @@ the shared library at runtime without needing `LD_LIBRARY_PATH`.
Add this project as a subdirectory in the CMakeLists.txt:

```cmake
add_subdirectory(path/to/c2pa-c)
add_subdirectory(path/to/c2pa-cpp)
target_link_libraries(your_target PRIVATE c2pa_cpp)
```

Expand Down
12 changes: 6 additions & 6 deletions docs/context-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ The `Settings` class provides methods for creating and manipulating configuratio

| Method | Description |
|--------|-------------|
| [`Settings()`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#a70274281f05d59ddcfda4aa21397b896) | Create default settings |
| [`Settings(data, format)`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#a695e6e8c5a8cf16e40d6522af1fc13dd) | Parse settings from a string. Format is `"json"` or `"toml"` |
| [`set(path, json_value)`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#a13810c5df3183aa2b0132e3c7c8edd1c) | Set a value by dot-separated path (e.g., `"verify.verify_after_sign"`). Value must be JSON-encoded. Returns `*this` for chaining |
| [`update(data)`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#a1bd09762fb2e6c4c937c814500826ecc) | Merge JSON configuration (same as `update(data, "json")`) |
| [`update(data, format)`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#a80a12a51569bd89cc18231c7c9c36242) | Merge configuration from a string with specified format |
| [`is_valid()`](https://contentauth.github.io/c2pa-c/da/d96/classc2pa_1_1Settings.html#add51c3e2ef459978be035b86803b338e) | Returns `true` if the object is valid (not moved-from) |
| [`Settings()`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#a70274281f05d59ddcfda4aa21397b896) | Create default settings |
| [`Settings(data, format)`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#a695e6e8c5a8cf16e40d6522af1fc13dd) | Parse settings from a string. Format is `"json"` or `"toml"` |
| [`set(path, json_value)`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#a13810c5df3183aa2b0132e3c7c8edd1c) | Set a value by dot-separated path (e.g., `"verify.verify_after_sign"`). Value must be JSON-encoded. Returns `*this` for chaining |
| [`update(data)`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#a1bd09762fb2e6c4c937c814500826ecc) | Merge JSON configuration (same as `update(data, "json")`) |
| [`update(data, format)`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#a80a12a51569bd89cc18231c7c9c36242) | Merge configuration from a string with specified format |
| [`is_valid()`](https://contentauth.github.io/c2pa-cpp/da/d96/classc2pa_1_1Settings.html#add51c3e2ef459978be035b86803b338e) | Returns `true` if the object is valid (not moved-from) |

> [!NOTE]
>
Expand Down
2 changes: 1 addition & 1 deletion docs/intents.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Enum values are in the global namespace:

### Using `set_intent`

Use the `Builder` [`set_intent`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#ac3ca980a43f44c9349ac0d6de50a088c) method to specify the intent:
Use the `Builder` [`set_intent`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#ac3ca980a43f44c9349ac0d6de50a088c) method to specify the intent:

```cpp
void Builder::set_intent(
Expand Down
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ifs.close();

The manifest JSON string defines the C2PA manifest to add to the file.

A sample JSON manifest is provided in [tests/fixtures/training.json](https://github.com/contentauth/c2pa-c/blob/main/tests/fixtures/training.json).
A sample JSON manifest is provided in [tests/fixtures/training.json](https://github.com/contentauth/c2pa-cpp/blob/main/tests/fixtures/training.json).

For example:

Expand Down Expand Up @@ -196,14 +196,14 @@ Trust affects manifest validation status: a manifest whose trust chain was verif

## More examples

The C++ example in [`examples/training.cpp`](https://github.com/contentauth/c2pa-c/blob/main/examples/training.cpp) uses the [JSON for Modern C++](https://json.nlohmann.me/) library class.
The C++ example in [`examples/training.cpp`](https://github.com/contentauth/c2pa-cpp/blob/main/examples/training.cpp) uses the [JSON for Modern C++](https://json.nlohmann.me/) library class.

Build and run the example by entering this `make` command:

```
make examples
```

This example adds the manifest [`tests/fixtures/training.json`](https://github.com/contentauth/c2pa-c/blob/main/tests/fixtures/training.json) to the image file [`tests/fixtures/A.jpg`](https://github.com/contentauth/c2pa-c/blob/main/tests/fixtures/A.jpg) using the sample private key and certificate in the [`tests/fixtures`](https://github.com/contentauth/c2pa-c/tree/main/tests/fixtures) directory.
This example adds the manifest [`tests/fixtures/training.json`](https://github.com/contentauth/c2pa-cpp/blob/main/tests/fixtures/training.json) to the image file [`tests/fixtures/A.jpg`](https://github.com/contentauth/c2pa-cpp/blob/main/tests/fixtures/A.jpg) using the sample private key and certificate in the [`tests/fixtures`](https://github.com/contentauth/c2pa-cpp/tree/main/tests/fixtures) directory.

The example displays some text to standard out that summarizes whether AI training is allowed based on the specified manifest and then saves the resulting image file with attached manifest to `build/examples/training.jpg`.
14 changes: 7 additions & 7 deletions docs/working-stores.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This table summarizes the fundamental entities that you work with when using the

| Object | Description | Where it is | Primary API |
|--------|-------------|-------------|-------------|
| [**Manifest store**](#manifest-store) | Final signed provenance data. Contains one or more manifests. | Embedded in asset or remotely in cloud | [`Reader`](https://contentauth.github.io/c2pa-c/d9/dbb/classc2pa_1_1Reader.html) class |
| [**Working store**](#working-store) | Editable in-progress manifest. | `Builder` object | [`Builder`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html) class |
| [**Archive**](#archive) | Serialized working store | `.c2pa` file/stream | [`Builder::to_archive()`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a68074eac71b7fc57d338019220101db3)<br/> [`Builder::from_archive()`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a913c64f6b5ec978322ef0edc89e407b3) |
| [**Resources**](#working-with-resources) | Binary assets referenced by manifest assertions, such as thumbnails or ingredient thumbnails. | In manifest. | [`Builder::add_resource()`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a45bf6fc8163b0194b334aa21f73f8476) <br/> [`Reader::get_resource`](https://contentauth.github.io/c2pa-c/d9/dbb/classc2pa_1_1Reader.html#a308939c990cab98bf8435c699bc96096) |
| [**Ingredients**](#working-with-ingredients) | Source materials used to create an asset. | In manifest. | [`builder.add_ingredient`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a49407f9604a53b5b68bcfa699cba05f5)
| [**Manifest store**](#manifest-store) | Final signed provenance data. Contains one or more manifests. | Embedded in asset or remotely in cloud | [`Reader`](https://contentauth.github.io/c2pa-cpp/d9/dbb/classc2pa_1_1Reader.html) class |
| [**Working store**](#working-store) | Editable in-progress manifest. | `Builder` object | [`Builder`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html) class |
| [**Archive**](#archive) | Serialized working store | `.c2pa` file/stream | [`Builder::to_archive()`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a68074eac71b7fc57d338019220101db3)<br/> [`Builder::from_archive()`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a913c64f6b5ec978322ef0edc89e407b3) |
| [**Resources**](#working-with-resources) | Binary assets referenced by manifest assertions, such as thumbnails or ingredient thumbnails. | In manifest. | [`Builder::add_resource()`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a45bf6fc8163b0194b334aa21f73f8476) <br/> [`Reader::get_resource`](https://contentauth.github.io/c2pa-cpp/d9/dbb/classc2pa_1_1Reader.html#a308939c990cab98bf8435c699bc96096) |
| [**Ingredients**](#working-with-ingredients) | Source materials used to create an asset. | In manifest. | [`builder.add_ingredient`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a49407f9604a53b5b68bcfa699cba05f5)

This diagram summarizes the relationships among these entities.

Expand Down Expand Up @@ -67,7 +67,7 @@ A _C2PA archive_ (or just _archive_) contains the serialized bytes of a working
**Characteristics:**

- Portable serialization of a working store (Builder).
- Save an archive by using [`Builder::to_archive()`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a68074eac71b7fc57d338019220101db3) and restore a full working store from an archive by using [`Builder::from_archive()`](https://contentauth.github.io/c2pa-c/da/db7/classc2pa_1_1Builder.html#a913c64f6b5ec978322ef0edc89e407b3).
- Save an archive by using [`Builder::to_archive()`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a68074eac71b7fc57d338019220101db3) and restore a full working store from an archive by using [`Builder::from_archive()`](https://contentauth.github.io/c2pa-cpp/da/db7/classc2pa_1_1Builder.html#a913c64f6b5ec978322ef0edc89e407b3).
- Useful for separating manifest preparation ("work in progress") from final signing.

For more information, see [Working with archives](#working-with-archives)
Expand Down Expand Up @@ -236,7 +236,7 @@ auto builder = c2pa::Builder(custom_context, manifest_json);

### Creating a Signer

For testing, create a [`Signer`](https://contentauth.github.io/c2pa-c/d3/da1/classc2pa_1_1Signer.html) with certificates and private key:
For testing, create a [`Signer`](https://contentauth.github.io/c2pa-cpp/d3/da1/classc2pa_1_1Signer.html) with certificates and private key:

```cpp
#include <fstream>
Expand Down
4 changes: 2 additions & 2 deletions scripts/amalgamate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ set(HEADER
// specific language governing permissions and limitations under
// each license.
// Amalgamated c2pa.cpp, automatically generated from c2pa-c sources during build.
// Amalgamated c2pa.cpp, automatically generated from c2pa-cpp sources during build.
// DO NOT EDIT MANUALLY, this file is generated by the build system.
// Built by c2pa-c. Single compilable translation unit for distribution.
// Built by c2pa-cpp. Single compilable translation unit for distribution.
// Include path: only c2pa.hpp (and code-requested system headers) required.
#include \"c2pa.hpp\"
Expand Down
Loading