|
c2pa-c
C++ API for c2pa-c library
|
Classes | |
| class | Builder |
| Builder class for creating a manifest. More... | |
| class | C2paException |
| class | CppIOStream |
| IOStream Class wrapper for C2paStream. More... | |
| class | CppIStream |
| Istream Class wrapper for C2paStream. More... | |
| class | CppOStream |
| Ostream Class wrapper for C2paStream. More... | |
| class | Reader |
| Reader class for reading a manifest. More... | |
| class | Signer |
| Signer class for creating a signer. More... | |
Typedefs | |
| typedef C2paSignerInfo | SignerInfo |
| using | SignerFunc = std::vector< unsigned char >(const std::vector< unsigned char > &) |
| Signer Callback function type. | |
Functions | |
| string | version () |
| Returns the version of the C2pa library. | |
| void | load_settings (const string &data, const string &format) |
| optional< string > | read_file (const filesystem::path &source_path, const optional< path > data_dir=nullopt) |
| std::string | read_ingredient_file (const path &source_path, const path &data_dir) |
| void | sign_file (const path &source_path, const path &dest_path, const char *manifest, SignerInfo *signer_info, const std::optional< path > data_dir=std::nullopt) |
| using c2pa::SignerFunc = typedef std::vector<unsigned char>(const std::vector<unsigned char> &) |
Signer Callback function type.
| data | the data to sign. |
This function type is used to create a callback function for signing.
| typedef C2paSignerInfo c2pa::SignerInfo |
| void c2pa::load_settings | ( | const string & | data, |
| const string & | format | ||
| ) |
Loads C2PA settings from a string in a given format.
| data | the string to load. |
| format | the mime format of the string. |
| a | C2pa::C2paException for errors encountered by the C2PA library. |
| optional< string > c2pa::read_file | ( | const filesystem::path & | source_path, |
| const optional< path > | data_dir = nullopt |
||
| ) |
Reads a file and returns the manifest json as a C2pa::String.
| source_path | the path to the file to read. |
| data_dir | the directory to store binary resources (optional). |
| a | C2pa::C2paException for errors encountered by the C2PA library. |
Reads a file and returns an ingredient JSON as a C2pa::String.
| source_path | the path to the file to read. |
| data_dir | the directory to store binary resources. |
| a | C2pa::C2paException for errors encountered by the C2PA library. |
| void c2pa::sign_file | ( | const path & | source_path, |
| const path & | dest_path, | ||
| const char * | manifest, | ||
| SignerInfo * | signer_info, | ||
| const std::optional< path > | data_dir = std::nullopt |
||
| ) |
Adds the manifest and signs a file.
| source_path | the path to the asset to be signed. |
| dest_path | the path to write the signed file to. |
| manifest | the manifest json to add to the file. |
| signer_info | the signer info to use for signing. |
| data_dir | the directory to store binary resources (optional). |
| a | C2pa::C2paException for errors encountered by the C2PA library. |
| string c2pa::version | ( | ) |
Returns the version of the C2pa library.