Skip to content

Commit ad2f4ad

Browse files
authored
chore: Update to latest c2pa-rs version
chore: Update to latest c2pa-rs version
1 parent 0fe645d commit ad2f4ad

File tree

3 files changed

+2
-43
lines changed

3 files changed

+2
-43
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ crate-type = ["lib", "cdylib"]
1212
normal = ["openssl-src"]
1313

1414
[dependencies]
15-
c2pa = { version = "0.41.1", features = ["unstable_api", "file_io", "openssl", "pdf", "fetch_remote_manifests"]}
16-
c2pa-crypto = {version = "0.3.1" }
15+
c2pa = { version = "0.42.0", features = ["unstable_api", "file_io", "openssl", "pdf", "fetch_remote_manifests"]}
1716
thiserror = "1.0.49"
1817
uniffi = "0.28.2"
1918
openssl-src = "=300.3.1" # Required for openssl-sys

src/callback_signer.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// each license.
1212

1313
use c2pa::{Signer, SigningAlg};
14-
// RawSigner is currently used only fully qualified
15-
use c2pa_crypto::{raw_signature::RawSignerError, time_stamp::TimeStampProvider};
1614
use log::debug;
1715

1816
use crate::Result;
@@ -36,41 +34,6 @@ pub struct RemoteSigner {
3634
reserve_size: u32,
3735
}
3836

39-
impl TimeStampProvider for RemoteSigner {}
40-
41-
impl c2pa_crypto::raw_signature::RawSigner for RemoteSigner {
42-
fn sign(&self, data: &[u8]) -> std::result::Result<Vec<u8>, RawSignerError> {
43-
let signature_result = self.signer_callback.sign(data.to_vec());
44-
45-
match signature_result {
46-
Ok(signature) => Ok(signature),
47-
Err(e) => Err(c2pa_crypto::raw_signature::RawSignerError::IoError(
48-
e.to_string(),
49-
)),
50-
}
51-
}
52-
53-
fn alg(&self) -> c2pa_crypto::raw_signature::SigningAlg {
54-
match self.alg {
55-
SigningAlg::Es384 => c2pa_crypto::raw_signature::SigningAlg::Es384,
56-
SigningAlg::Es512 => c2pa_crypto::raw_signature::SigningAlg::Es512,
57-
SigningAlg::Ps256 => c2pa_crypto::raw_signature::SigningAlg::Ps256,
58-
SigningAlg::Ps384 => c2pa_crypto::raw_signature::SigningAlg::Ps384,
59-
SigningAlg::Ps512 => c2pa_crypto::raw_signature::SigningAlg::Ps512,
60-
SigningAlg::Ed25519 => c2pa_crypto::raw_signature::SigningAlg::Ed25519,
61-
SigningAlg::Es256 => c2pa_crypto::raw_signature::SigningAlg::Es256,
62-
}
63-
}
64-
65-
fn cert_chain(&self) -> std::result::Result<Vec<Vec<u8>>, RawSignerError> {
66-
Ok(Vec::new())
67-
}
68-
69-
fn reserve_size(&self) -> usize {
70-
self.reserve_size as usize
71-
}
72-
}
73-
7437
impl Signer for RemoteSigner {
7538
fn sign(&self, data: &[u8]) -> c2pa::Result<Vec<u8>> {
7639
self.signer_callback
@@ -94,10 +57,6 @@ impl Signer for RemoteSigner {
9457
fn direct_cose_handling(&self) -> bool {
9558
true
9659
}
97-
98-
fn raw_signer(&self) -> Box<&dyn c2pa_crypto::raw_signature::RawSigner> {
99-
Box::new(self)
100-
}
10160
}
10261

10362
impl CallbackSigner {

tests/test_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def getitem(d, key):
5252
]
5353
}
5454

55+
# ingredient we will use for testing
5556
ingredient_def = {
5657
"relationship": "parentOf",
5758
"thumbnail": {

0 commit comments

Comments
 (0)