Skip to main content

Signer

Trait Signer 

Source
pub trait Signer: Send + Sync {
    // Required methods
    fn pubkey(&self) -> [u8; 32];
    fn sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        canonical_bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<[u8; 64]>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn pq_pubkey(&self) -> Option<Vec<u8>> { ... }
    fn pq_sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _canonical_bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Signing abstraction for Ed25519 envelope signatures.

Native: LocalSigner owns the SigningKey and signs synchronously. WASM: JsSigner delegates to a JS callback (aegis-vault) and awaits the result.

§Safety (wasm32)

JsSigner holds js_sys::Function which is !Send. We use unsafe impl Send + Sync on it because wasm32 is single-threaded. The Send + Sync bounds on this trait are required so that RpcClient<S, T> can be used with Arc and tokio::spawn on native.

Required Methods§

Source

fn pubkey(&self) -> [u8; 32]

Ed25519 public key (32 bytes).

Source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, canonical_bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<[u8; 64]>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sign canonical envelope bytes. Returns 64-byte Ed25519 signature.

Provided Methods§

Source

fn pq_pubkey(&self) -> Option<Vec<u8>>

ML-DSA-65 verifying key bytes (1952 bytes) when PQ hybrid is available.

Source

fn pq_sign<'life0, 'life1, 'async_trait>( &'life0 self, _canonical_bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

ML-DSA-65 signature over canonical envelope bytes.

Implementors§