Describe the feature
We would like to request for an improved implementation of the callback mechanism for the Signer.
Currently this callback is implemented as a static callback function without the ability to capture any state or user data to be available for the user when receiving the callback. This is different for new Progress/Cancel API where the call mechanism uses a std::function which makes it possible to capture variables into the callback function.
The current signer callback function is defined as:
using SignerFunc = std::vector<unsigned char>(const std::vector<unsigned char> &);
We suggest (as example) that it could be something like this:
using SignerFuncStd = std::function<std::vector<unsigned char>(const std::vector<unsigned char>&)>;
I guess it would require some more internal lifetime management for the callback function similar to for the Progress callback.
To retain backward combability (if required), the new callback function could be supported by a new Signer constructor overload.¨
Is your feature request related to a problem?
We have been struggling a bit with the existing "static callback" approach for Signer, of multiple reasons:
- Our desktop application can be connected to multiple servers at the same time. These servers are called out to in the Signer callback. Basically we want to call different services from the same desktop app based connection mentioned.
- Backend code does batch c2pa signing as part of batch processing of multiple assets. In this case we have a session to a Key Vault service that we want to reuse for all Signer callbacks in the batch processing. This is for performance reasons.
- Backend code serves multiple tenants in the same process and signing certificates/keys may possibly differ per tenant.
- Have the ability of passing a logging scope to the Signer callback
In all these cases we benefit from having the ability to pass some user data to the Signer callback function - making the code easier and more convenient to implement.
Describe alternatives you've considered
N/A
Additional context
We are currently using the c2pa-c SDK for implementing C2PA support in our DAM (digital asset management) products.
Describe the feature
We would like to request for an improved implementation of the callback mechanism for the Signer.
Currently this callback is implemented as a static callback function without the ability to capture any state or user data to be available for the user when receiving the callback. This is different for new Progress/Cancel API where the call mechanism uses a std::function which makes it possible to capture variables into the callback function.
The current signer callback function is defined as:
using SignerFunc = std::vector<unsigned char>(const std::vector<unsigned char> &);We suggest (as example) that it could be something like this:
using SignerFuncStd = std::function<std::vector<unsigned char>(const std::vector<unsigned char>&)>;I guess it would require some more internal lifetime management for the callback function similar to for the Progress callback.
To retain backward combability (if required), the new callback function could be supported by a new Signer constructor overload.¨
Is your feature request related to a problem?
We have been struggling a bit with the existing "static callback" approach for Signer, of multiple reasons:
In all these cases we benefit from having the ability to pass some user data to the Signer callback function - making the code easier and more convenient to implement.
Describe alternatives you've considered
N/A
Additional context
We are currently using the c2pa-c SDK for implementing C2PA support in our DAM (digital asset management) products.