diff --git a/Cargo.toml b/Cargo.toml index d5638ad5..77d22e16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,7 @@ crate-type = ["lib", "cdylib"] normal = ["openssl-src"] [dependencies] -c2pa = { version = "0.41.1", features = ["unstable_api", "file_io", "openssl", "pdf", "fetch_remote_manifests"]} -c2pa-crypto = {version = "0.3.1" } +c2pa = { version = "0.42.0", features = ["unstable_api", "file_io", "openssl", "pdf", "fetch_remote_manifests"]} thiserror = "1.0.49" uniffi = "0.28.2" openssl-src = "=300.3.1" # Required for openssl-sys diff --git a/src/callback_signer.rs b/src/callback_signer.rs index a033dc02..4be2d3ea 100644 --- a/src/callback_signer.rs +++ b/src/callback_signer.rs @@ -11,8 +11,6 @@ // each license. use c2pa::{Signer, SigningAlg}; -// RawSigner is currently used only fully qualified -use c2pa_crypto::{raw_signature::RawSignerError, time_stamp::TimeStampProvider}; use log::debug; use crate::Result; @@ -36,41 +34,6 @@ pub struct RemoteSigner { reserve_size: u32, } -impl TimeStampProvider for RemoteSigner {} - -impl c2pa_crypto::raw_signature::RawSigner for RemoteSigner { - fn sign(&self, data: &[u8]) -> std::result::Result, RawSignerError> { - let signature_result = self.signer_callback.sign(data.to_vec()); - - match signature_result { - Ok(signature) => Ok(signature), - Err(e) => Err(c2pa_crypto::raw_signature::RawSignerError::IoError( - e.to_string(), - )), - } - } - - fn alg(&self) -> c2pa_crypto::raw_signature::SigningAlg { - match self.alg { - SigningAlg::Es384 => c2pa_crypto::raw_signature::SigningAlg::Es384, - SigningAlg::Es512 => c2pa_crypto::raw_signature::SigningAlg::Es512, - SigningAlg::Ps256 => c2pa_crypto::raw_signature::SigningAlg::Ps256, - SigningAlg::Ps384 => c2pa_crypto::raw_signature::SigningAlg::Ps384, - SigningAlg::Ps512 => c2pa_crypto::raw_signature::SigningAlg::Ps512, - SigningAlg::Ed25519 => c2pa_crypto::raw_signature::SigningAlg::Ed25519, - SigningAlg::Es256 => c2pa_crypto::raw_signature::SigningAlg::Es256, - } - } - - fn cert_chain(&self) -> std::result::Result>, RawSignerError> { - Ok(Vec::new()) - } - - fn reserve_size(&self) -> usize { - self.reserve_size as usize - } -} - impl Signer for RemoteSigner { fn sign(&self, data: &[u8]) -> c2pa::Result> { self.signer_callback @@ -94,10 +57,6 @@ impl Signer for RemoteSigner { fn direct_cose_handling(&self) -> bool { true } - - fn raw_signer(&self) -> Box<&dyn c2pa_crypto::raw_signature::RawSigner> { - Box::new(self) - } } impl CallbackSigner { diff --git a/tests/test_api.py b/tests/test_api.py index c9758100..66922b60 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -52,6 +52,7 @@ def getitem(d, key): ] } +# ingredient we will use for testing ingredient_def = { "relationship": "parentOf", "thumbnail": {