contentauth / c2pa-rs

Rust SDK for the core C2PA (Coalition for Content Provenance and Authenticity) specification
Other
116 stars 51 forks source link

Converge Signer and AsyncSinger in to a single trait #358

Open duggaraju opened 9 months ago

duggaraju commented 9 months ago

AsyncSigner can be used everywhere and avoid two different sets of APIs?

duggaraju commented 9 months ago

Right now I can call manifest.save_from_memory() to sign from web assembly. However it takes Signer trait. But since implementation in javascript (remote or webcrypto) return promises it would be hard to implement the same. If we had a similar function that takes AsyncSigner then it can be fully implemented in web assembly. In general to avoid confusion and duplication, might be better to converge on a single AsyncSigner trait everywhere.

mauricefisher64 commented 8 months ago

We have clients that cannot use async. Two APIs will likely remain for the foreseeable future.

duggaraju commented 8 months ago

Oh. I see. If so can we use the async_generic trait so there is both async and sync support for functions like Manifest.embed_from_memory() and Manifest::embed_to_stream and the corresponding store functions. Right now, the macro is used inconsistently.

gpeacock commented 7 months ago

Yes, we are working on consolidating that code so there is as little code duplication as possible.