pub struct SpizeNativeProvider { /* private fields */ }Expand description
Spize native identity provider backed by Ed25519.
The agent_id takes the canonical form spize:{org}/{name}:{fingerprint}
where fingerprint is the first 6 hex chars of SHA-256 over the public
key. This means the agent_id is DERIVED from the key — you cannot forge
an agent_id without holding the matching private key, which gives strong
binding at the naming layer on top of the signature verification layer.
Implementations§
Source§impl SpizeNativeProvider
impl SpizeNativeProvider
Sourcepub fn generate(
org: &str,
name: &str,
peer_registry: Arc<PeerRegistry>,
) -> Result<Self>
pub fn generate( org: &str, name: &str, peer_registry: Arc<PeerRegistry>, ) -> Result<Self>
Generate a fresh keypair with a new random secret.
Sourcepub fn from_secret_bytes(
org: &str,
name: &str,
secret: [u8; 32],
peer_registry: Arc<PeerRegistry>,
) -> Result<Self>
pub fn from_secret_bytes( org: &str, name: &str, secret: [u8; 32], peer_registry: Arc<PeerRegistry>, ) -> Result<Self>
Load a provider from an existing raw secret key (e.g., from disk).
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
The public key bytes. Share these to let peers verify this agent’s
signatures (in a real deployment, via registration at
POST /v1/agents/register).
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
The verifying key struct (for tests and direct registry insertion).
Sourcepub fn secret_key_bytes(&self) -> [u8; 32]
pub fn secret_key_bytes(&self) -> [u8; 32]
Raw secret key bytes (32). Used by platforms that own their own identity file — the desktop app, for example, must persist this to a 0600 file. NEVER transmit these over the wire.
Trait Implementations§
Source§impl IdentityProvider for SpizeNativeProvider
impl IdentityProvider for SpizeNativeProvider
Source§fn agent_id(&self) -> &AgentId
fn agent_id(&self) -> &AgentId
sign() will produce signatures for).Source§fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn verify_peer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
peer_id: &'life1 AgentId,
message: &'life2 [u8],
signature: &'life3 Signature,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn verify_peer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
peer_id: &'life1 AgentId,
message: &'life2 [u8],
signature: &'life3 Signature,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn trust_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
_peer_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Option<TrustMetadata>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn trust_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
_peer_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Option<TrustMetadata>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
None if this provider does not support
trust metadata — callers must handle that gracefully. Read more