core: add verify traits

This commit is contained in:
Aode (lion) 2021-11-18 21:05:40 -06:00
parent 86a8b6f181
commit ec1bf8640f

View file

@ -13,3 +13,15 @@ pub trait SignFactory {
fn key_id(&self) -> Self::KeyId;
fn signer(&self) -> Self::Signer;
}
pub trait Verify {
type Error: std::error::Error + Send;
fn verify(&self, signing_string: &str, signature: &str) -> Result<bool, Self::Error>;
}
pub trait VerifyFactory {
type Verifier: Verify + Send + 'static;
fn verifier(&self, public_key_pem: String) -> Self::Verifier;
}