Skip to main content

MeshSigner

Trait MeshSigner 

Source
pub trait MeshSigner: Send + Sync {
    // Required methods
    fn verifying_key(&self) -> VerifyingKey;
    fn sign(&self, msg: &[u8]) -> Signature;
}
Expand description

Something that can sign mesh messages without necessarily exposing its private key.

Implemented by AgentKey for the software (in-memory seed) case. Platform-keystore implementations (Android/iOS) are explicitly out of scope here — this trait is the seam they will plug into without touching the envelope/transport call sites.

Send + Sync so a signer can be shared behind an Arc across the tokio-spawn boundaries the transport layer uses.

Required Methods§

Source

fn verifying_key(&self) -> VerifyingKey

The ed25519 public half of this signer’s key. Must match the agent_pubkey of the CertChain it is paired with, or the resulting signatures will not verify against the cert.

Source

fn sign(&self, msg: &[u8]) -> Signature

Produce an ed25519 signature over msg.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl MeshSigner for AgentKey

AgentKey is the software (in-memory seed) [MeshSigner]: it signs with the seed it holds. This is today’s behavior, surfaced through the trait so the envelope/transport layers can sign via &dyn MeshSigner and a future non-exportable keystore signer drops in at the same call sites.