pub struct ZeroizingKeypair { /* private fields */ }Expand description
Zeroize-on-drop wrapper for snow::Keypair.
snow::Keypair has no Drop impl, so the private key persists in freed
memory if not explicitly zeroized. This wrapper guarantees zeroization on
drop, including during panics (unwind calls Drop).
All code that constructs or receives a snow::Keypair should use this
wrapper instead. The private key is accessible via private() for
passing to snow::Builder::local_private_key().
Implementations§
Source§impl ZeroizingKeypair
impl ZeroizingKeypair
Sourcepub fn private(&self) -> &[u8] ⓘ
pub fn private(&self) -> &[u8] ⓘ
Access the private key (32 bytes). Use only for snow::Builder calls.
Sourcepub fn as_inner(&self) -> &Keypair
pub fn as_inner(&self) -> &Keypair
Borrow the inner snow::Keypair for APIs that require &snow::Keypair.
Sourcepub fn into_inner(self) -> Keypair
pub fn into_inner(self) -> Keypair
Consume the wrapper and return the inner snow::Keypair.
The caller takes responsibility for zeroizing the private key.
Use only when transferring ownership to an API that requires snow::Keypair
(e.g., BusServer::bind).