apub/apub-signer/src/lib.rs
2021-11-17 22:17:36 -06:00

16 lines
337 B
Rust

use std::fmt::Display;
pub trait Sign {
type Error: std::error::Error + Send;
fn sign(&self, signing_string: &str) -> Result<String, Self::Error>;
}
pub trait SignFactory {
type Signer: Sign + Send + 'static;
type KeyId: Display + 'static;
fn key_id(&self) -> Self::KeyId;
fn signer(&self) -> Self::Signer;
}