http_msgsign_draft/
sign.rs1use crate::errors::VerificationError;
2
3mod base;
4mod component;
5mod field;
6mod input;
7pub mod params;
8mod request;
9mod response;
10
11pub(crate) use self::base::*;
12pub(crate) use self::input::*;
13pub use self::params::*;
14
15pub use self::request::*;
16pub use self::response::*;
17
18pub trait SignerKey: 'static + Sync + Send {
19 fn id(&self) -> String;
20 fn algorithm(&self) -> String;
21
22 fn sign(&self, target: &[u8]) -> Vec<u8>;
23}
24
25pub trait VerifierKey: 'static + Sync + Send {
26 fn id(&self) -> String;
27 fn algorithm(&self) -> String;
28
29 fn verify(&self, target: &[u8], sig: &[u8]) -> Result<(), VerificationError>;
30}