|
c2pa-c
C++ API for c2pa-c library
|
Signer class for creating a Signer. More...
#include <c2pa.hpp>
Public Member Functions | |
| Signer (SignerFunc *callback, C2paSigningAlg alg, const std::string &sign_cert, const std::string &tsa_uri) | |
| Create a Signer from a callback function. | |
| Signer (C2paSigner *c_signer) | |
| Create a signer from a Signer pointer and take ownership of that pointer. | |
| Signer (const std::string &alg, const std::string &sign_cert, const std::string &private_key, const std::optional< std::string > &tsa_uri=std::nullopt) | |
| Create a Signer from signing credentials. | |
| Signer (const Signer &)=delete | |
| Signer & | operator= (const Signer &)=delete |
| Signer (Signer &&other) noexcept | |
| Move constructor. | |
| Signer & | operator= (Signer &&other) noexcept |
| ~Signer () | |
| uintptr_t | reserve_size () |
| Get the size to reserve for a signature for this Signer. | |
| C2paSigner * | c2pa_signer () const noexcept |
| Get the underlying C2paSigner pointer. | |
Friends | |
| class | Context::ContextBuilder |
Signer class for creating a Signer.
This class is used to create a signer from a signing algorithm, certificate, and TSA URI. Supports both callback-based and direct signing methods.
| c2pa::Signer::Signer | ( | SignerFunc * | callback, |
| C2paSigningAlg | alg, | ||
| const std::string & | sign_cert, | ||
| const std::string & | tsa_uri | ||
| ) |
Create a Signer from a callback function.
| callback | The callback function to use for signing. |
| alg | The signing algorithm to use (e.g., C2paSigningAlg::PS256). |
| sign_cert | The signing certificate in PEM format. |
| tsa_uri | The timestamp authority URI for time-stamping. |
| C2paException | if signer creation fails. |
|
inline |
Create a signer from a Signer pointer and take ownership of that pointer.
| c_signer | The C2paSigner pointer (must be non-null). |
| c2pa::Signer::Signer | ( | const std::string & | alg, |
| const std::string & | sign_cert, | ||
| const std::string & | private_key, | ||
| const std::optional< std::string > & | tsa_uri = std::nullopt |
||
| ) |
Create a Signer from signing credentials.
| alg | Signing algorithm name (e.g., "ps256", "es256"). |
| sign_cert | Signing certificate in PEM format. |
| private_key | Private key in PEM format. |
| tsa_uri | Optional timestamp authority URI. |
| C2paException | if signer creation fails. |
|
delete |
|
inlinenoexcept |
Move constructor.
| other | Signer to move from. |
| c2pa::Signer::~Signer | ( | ) |
|
noexcept |
Get the underlying C2paSigner pointer.
| uintptr_t c2pa::Signer::reserve_size | ( | ) |
Get the size to reserve for a signature for this Signer.
|
friend |