diff options
Diffstat (limited to 'server/src/apub/mod.rs')
-rw-r--r-- | server/src/apub/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/apub/mod.rs b/server/src/apub/mod.rs index 05792968..9c02d107 100644 --- a/server/src/apub/mod.rs +++ b/server/src/apub/mod.rs @@ -141,6 +141,8 @@ pub trait FromApub { pub trait ActorType { fn actor_id(&self) -> String; + fn public_key(&self) -> String; + fn get_inbox_url(&self) -> String { format!("{}/inbox", &self.actor_id()) } @@ -157,4 +159,13 @@ pub trait ActorType { fn get_liked_url(&self) -> String { format!("{}/liked", &self.actor_id()) } + + fn get_public_key_ext(&self) -> PublicKeyExtension { + PublicKey { + id: format!("{}#main-key", self.actor_id()), + owner: self.actor_id(), + public_key_pem: self.public_key(), + } + .to_ext() + } } |