diff --git a/apub-core/src/deliver.rs b/apub-core/src/deliver.rs index ffddfba..45e83ea 100644 --- a/apub-core/src/deliver.rs +++ b/apub-core/src/deliver.rs @@ -5,9 +5,6 @@ pub trait Client<'a> { type Error: std::error::Error + 'static; type Future: Future> + 'a; - fn deliver<'b, T: serde::ser::Serialize>( - &'b self, - inbox: &'a Url, - activity: &'a T, - ) -> Self::Future; + fn deliver(&'a self, inbox: &'a Url, activity: &'a T) + -> Self::Future; } diff --git a/apub-core/src/digest.rs b/apub-core/src/digest.rs index 8e9a3e9..4709868 100644 --- a/apub-core/src/digest.rs +++ b/apub-core/src/digest.rs @@ -1,11 +1,10 @@ pub trait Digest { const NAME: &'static str; + fn build() -> Self; fn digest(self, input: &[u8]) -> String; } pub trait DigestFactory { type Digest: Digest + Send; - - fn digest(&self) -> Self::Digest; } diff --git a/apub-core/src/signature.rs b/apub-core/src/signature.rs index bc4a0f6..f78f4b2 100644 --- a/apub-core/src/signature.rs +++ b/apub-core/src/signature.rs @@ -17,11 +17,13 @@ pub trait SignFactory { pub trait Verify { type Error: std::error::Error + Send; + fn build(public_key_pem: &str) -> Result + where + Self: Sized; + 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; }