c2pa-rs icon indicating copy to clipboard operation
c2pa-rs copied to clipboard

Some functions are unavailable on WASM

Open ivan770 opened this issue 1 year ago • 2 comments

Hi. I noticed that some of the internal functionality is unavailable on WebAssembly targets.

For instance, when trying to sign a manifest using this crate built for WASM, I get an error from the following function: https://github.com/contentauth/c2pa-rs/blob/d72c43d60b34b90c49e6b5be0ba0d4183bb3997d/sdk/src/cose_validator.rs#L1214-L1224

The exact same code built for x86_64 works fine.

I managed to make the library compile by removing some of those #[cfg(...)] macros, but I did not test the usability of the library in that case. Is it possible to make x86_64 and WASM equivalent in terms of supported functionality?

ivan770 avatar Jul 24 '24 17:07 ivan770

We only suppprt verify_cose_aysnc though the wasm32 path. There are features in that code path that do not have wasm32 support that we do not yet have solutions for.

mauricefisher64 avatar Aug 06 '24 16:08 mauricefisher64

You can sign via the async code paths.

mauricefisher64 avatar Aug 06 '24 16:08 mauricefisher64

It is not a standard build we create but it should now be possible.

mauricefisher64 avatar Dec 17 '24 19:12 mauricefisher64