pub struct AgentKey(/* private fields */);Expand description
An agent’s secret key. Zeroized on drop by ed25519-dalek’s default features.
Implementations§
Source§impl AgentKey
impl AgentKey
pub fn from_b64(s: &str) -> Result<Self>
pub fn to_b64(&self) -> String
pub fn id(&self) -> AgentId
Sourcepub fn sign(
&self,
to: AgentId,
text: &str,
ts: u64,
msg_id: &str,
) -> SignedMessage
pub fn sign( &self, to: AgentId, text: &str, ts: u64, msg_id: &str, ) -> SignedMessage
Sign a plain message to to. ts and msg_id are covered, giving replay
protection when paired with the receiver’s dedupe set.
Sourcepub fn sign_as(
&self,
to: AgentId,
text: &str,
ts: u64,
msg_id: &str,
kind: MessageKind,
) -> SignedMessage
pub fn sign_as( &self, to: AgentId, text: &str, ts: u64, msg_id: &str, kind: MessageKind, ) -> SignedMessage
Sign a message of a specific kind (plain, or a pairing knock/accept).
Sourcepub fn sign_full(
&self,
to: AgentId,
text: &str,
ts: u64,
msg_id: &str,
kind: MessageKind,
task_id: Option<&str>,
status: Option<TaskStatus>,
in_reply_to: Option<&str>,
) -> SignedMessage
pub fn sign_full( &self, to: AgentId, text: &str, ts: u64, msg_id: &str, kind: MessageKind, task_id: Option<&str>, status: Option<TaskStatus>, in_reply_to: Option<&str>, ) -> SignedMessage
Sign a message carrying optional task-tracking metadata; all of it —
status, task_id, in_reply_to — is covered by the signature, so a
relay can’t forge a Canceled or flip a status in flight.
Sourcepub fn announce(&self, name: &str, ts: u64) -> Announcement
pub fn announce(&self, name: &str, ts: u64) -> Announcement
Sign a presence announcement: “this key is online, calling itself name”.
Auto Trait Implementations§
impl Freeze for AgentKey
impl RefUnwindSafe for AgentKey
impl Send for AgentKey
impl Sync for AgentKey
impl Unpin for AgentKey
impl UnsafeUnpin for AgentKey
impl UnwindSafe for AgentKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more