1111// each license.
1212
1313use c2pa:: { Signer , SigningAlg } ;
14- // RawSigner is currently used only fully qualified
15- use c2pa_crypto:: { raw_signature:: RawSignerError , time_stamp:: TimeStampProvider } ;
1614use log:: debug;
1715
1816use 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-
7437impl 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
10362impl CallbackSigner {
0 commit comments