Skip to main content

SpizeNativeProvider

Struct SpizeNativeProvider 

Source
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

Source

pub fn generate( org: &str, name: &str, peer_registry: Arc<PeerRegistry>, ) -> Result<Self>

Generate a fresh keypair with a new random secret.

Source

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).

Source

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).

Source

pub fn verifying_key(&self) -> VerifyingKey

The verifying key struct (for tests and direct registry insertion).

Source

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

Source§

fn agent_id(&self) -> &AgentId

The agent this provider represents (i.e., the identity that 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,

Sign an arbitrary byte string with the agent’s private key. Read more
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,

Verify that signature was produced by peer_id over message. Read more
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,

Optional: fetch trust metadata about a peer (reputation, verification level, capabilities). Returns None if this provider does not support trust metadata — callers must handle that gracefully. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more