diff --git a/apub-core/src/signature.rs b/apub-core/src/signature.rs index 03533bc..bc4a0f6 100644 --- a/apub-core/src/signature.rs +++ b/apub-core/src/signature.rs @@ -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; +} + +pub trait VerifyFactory { + type Verifier: Verify + Send + 'static; + + fn verifier(&self, public_key_pem: String) -> Self::Verifier; +}