1mod base;
2mod input;
3mod params;
4mod request;
5mod response;
6mod signature;
7
8pub mod header {
9 pub const SIGNATURE: &str = "signature";
10 pub const SIGNATURE_INPUT: &str = "signature-input";
11}
12
13pub use self::{base::SignatureBase, input::*, params::SignatureParams, request::*, response::*};
14
15pub trait SignerKey: 'static + Sync + Send {
16 const ALGORITHM: &'static str;
17
18 fn key_id(&self) -> String;
19 fn sign(&self, target: &[u8]) -> Vec<u8>;
20}
21
22pub trait VerifierKey: 'static + Sync + Send {
23 const ALGORITHM: &'static str;
24
25 fn key_id(&self) -> String;
26 fn verify(
27 &self,
28 target: &[u8],
29 signature: &[u8],
30 ) -> Result<(), crate::errors::VerificationError>;
31}