Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions crates/nostr/src/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,6 @@ impl Keys {
&self.secret_key
}

/// Get keypair
#[inline]
pub fn keypair(&self) -> &Keypair {
&self.keypair
}

/// Creates a schnorr signature of the [`Message`].
///
/// This method uses a random number generator that retrieves randomness from the operating system (see [`SysRng`]).
Expand Down Expand Up @@ -265,6 +259,16 @@ impl FromStr for Keys {
}
}

impl Drop for Keys {
#[inline]
fn drop(&mut self) {
// Erase the keypair.
//
// NOTE: we already erase the secret key in 'impl Drop for SecretKey'.
self.keypair.non_secure_erase();
}
}

impl GetPublicKey for Keys {
type Error = Infallible;

Expand Down
Loading