pub struct LocalSigner { /* private fields */ }Expand description
Native signer that owns an Ed25519 signing key.
Signs synchronously — the async wrapper resolves immediately. Used for server-to-server RPC where the signing key is local.
SigningKey derives ZeroizeOnDrop from ed25519-dalek ≥ 2.0, so the
Ed25519 key bytes are zeroed when the LocalSigner is dropped. The ML-DSA
key is an opaque byte buffer (ml_dsa crate) without ZeroizeOnDrop; we
zero it explicitly in our Drop impl.
Implementations§
Source§impl LocalSigner
impl LocalSigner
Sourcepub fn new(signing_key: SigningKey) -> Self
pub fn new(signing_key: SigningKey) -> Self
Create a native signer.
The post-quantum half is the node’s persistent mesh ML-DSA-65 key,
derived deterministically from signing_key via
crate::node_identity::derive_mesh_mldsa_key (#157). This replaces the
previous ephemeral keygen so the signer’s ML-DSA public key is stable
across restarts and equals the #mesh-pq key peers anchor in their PQ
trust store. Use Self::with_pq_key only to override with an
externally supplied key (e.g. tests).
pub fn with_pq_key(self, key: MlDsaSigningKey) -> Self
pub fn signing_key(&self) -> &SigningKey
Trait Implementations§
Source§impl Debug for LocalSigner
impl Debug for LocalSigner
Source§impl Signer for LocalSigner
impl Signer for LocalSigner
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,
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,
Auto Trait Implementations§
impl Freeze for LocalSigner
impl RefUnwindSafe for LocalSigner
impl Send for LocalSigner
impl Sync for LocalSigner
impl Unpin for LocalSigner
impl UnsafeUnpin for LocalSigner
impl UnwindSafe for LocalSigner
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more