pub struct PrivateKey { /* private fields */ }Expand description
A validated secp256k1 private key that zeroizes its bytes on drop.
Created by generate. The key is guaranteed to be a
valid scalar in the range [1, n-1] where n is the secp256k1 curve order.
When this value goes out of scope, the underlying bytes are securely overwritten with zeros to prevent secrets from lingering in memory.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn to_secret_key(&self) -> SecretKey
pub fn to_secret_key(&self) -> SecretKey
Converts the private key into a secp256k1::SecretKey for use with
the secp256k1 crate directly.
Trait Implementations§
Source§impl Drop for PrivateKey
impl Drop for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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
Mutably borrows from an owned value. Read more