pub struct SecretKey(_);
Expand description
Secret 256-bit key used as x
in an ECDSA signature
Implementations§
source§impl SecretKey
impl SecretKey
sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Converts the object to a mutable raw pointer for FFI interfacing
source§impl SecretKey
impl SecretKey
sourcepub fn new<R: Rng, C>(secp: &Secp256k1<C>, rng: &mut R) -> SecretKey
pub fn new<R: Rng, C>(secp: &Secp256k1<C>, rng: &mut R) -> SecretKey
Creates a new random secret key. Requires compilation with the “rand” feature.
sourcepub fn from_slice<C>(
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<SecretKey, Error>
pub fn from_slice<C>(
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<SecretKey, Error>
Converts a SECRET_KEY_SIZE
-byte slice to a secret key
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<SecretKey, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<SecretKey, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for SecretKey
impl Ord for SecretKey
source§impl PartialOrd<SecretKey> for SecretKey
impl PartialOrd<SecretKey> for SecretKey
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more