11
11
// each license.
12
12
13
13
use c2pa:: { Signer , SigningAlg } ;
14
- // RawSigner is currently used only fully qualified
15
- use c2pa_crypto:: { raw_signature:: RawSignerError , time_stamp:: TimeStampProvider } ;
16
14
use log:: debug;
17
15
18
16
use crate :: Result ;
@@ -36,41 +34,6 @@ pub struct RemoteSigner {
36
34
reserve_size : u32 ,
37
35
}
38
36
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
-
74
37
impl Signer for RemoteSigner {
75
38
fn sign ( & self , data : & [ u8 ] ) -> c2pa:: Result < Vec < u8 > > {
76
39
self . signer_callback
@@ -94,10 +57,6 @@ impl Signer for RemoteSigner {
94
57
fn direct_cose_handling ( & self ) -> bool {
95
58
true
96
59
}
97
-
98
- fn raw_signer ( & self ) -> Box < & dyn c2pa_crypto:: raw_signature:: RawSigner > {
99
- Box :: new ( self )
100
- }
101
60
}
102
61
103
62
impl CallbackSigner {
0 commit comments