Struct libsecp256k1_rs::SecretKey [−][src]
pub struct SecretKey(_);
Secret key (256-bit) on a secp256k1 curve.
Methods
impl SecretKey
[src]
impl SecretKey
pub fn parse(p: &[u8; 32]) -> Result<SecretKey, Error>
[src]
pub fn parse(p: &[u8; 32]) -> Result<SecretKey, Error>
Read a 32-byte array into a Secret key
pub fn from_hex(h: &str) -> Result<SecretKey, Error>
[src]
pub fn from_hex(h: &str) -> Result<SecretKey, Error>
pub fn to_hex(&self) -> String
[src]
pub fn to_hex(&self) -> String
Return the hexadecimal representation of the secret key
pub fn random<R: Rng>(rng: &mut R) -> SecretKey
[src]
pub fn random<R: Rng>(rng: &mut R) -> SecretKey
Create a new random secret key
Examples
extern crate rand; extern crate libsecp256k1_rs as secp256k1; use rand::thread_rng; use secp256k1::SecretKey; let k1 = SecretKey::random(&mut thread_rng());
pub fn serialize(&self) -> [u8; 32]
[src]
pub fn serialize(&self) -> [u8; 32]
Represent a SecretKey as a 32-byte array
pub fn inv(&self) -> SecretKey
[src]
pub fn inv(&self) -> SecretKey
Trait Implementations
impl Debug for SecretKey
[src]
impl Debug for SecretKey
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for SecretKey
[src]
impl Clone for SecretKey
fn clone(&self) -> SecretKey
[src]
fn clone(&self) -> SecretKey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for SecretKey
[src]
impl Copy for SecretKey
impl Eq for SecretKey
[src]
impl Eq for SecretKey
impl PartialEq for SecretKey
[src]
impl PartialEq for SecretKey
fn eq(&self, other: &SecretKey) -> bool
[src]
fn eq(&self, other: &SecretKey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SecretKey) -> bool
[src]
fn ne(&self, other: &SecretKey) -> bool
This method tests for !=
.
impl Display for SecretKey
[src]
impl Display for SecretKey
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Into<Scalar> for SecretKey
[src]
impl Into<Scalar> for SecretKey
impl Add for SecretKey
[src]
impl Add for SecretKey
type Output = SecretKey
The resulting type after applying the +
operator.
fn add(self, rhs: SecretKey) -> Self::Output
[src]
fn add(self, rhs: SecretKey) -> Self::Output
Performs the +
operation.
impl Sub for SecretKey
[src]
impl Sub for SecretKey
type Output = SecretKey
The resulting type after applying the -
operator.
fn sub(self, rhs: SecretKey) -> SecretKey
[src]
fn sub(self, rhs: SecretKey) -> SecretKey
Performs the -
operation.
impl Mul<SecretKey> for SecretKey
[src]
impl Mul<SecretKey> for SecretKey
type Output = SecretKey
The resulting type after applying the *
operator.
fn mul(self, rhs: SecretKey) -> SecretKey
[src]
fn mul(self, rhs: SecretKey) -> SecretKey
Performs the *
operation.
impl Mul<PublicKey> for SecretKey
[src]
impl Mul<PublicKey> for SecretKey
type Output = PublicKey
The resulting type after applying the *
operator.
fn mul(self, rhs: PublicKey) -> PublicKey
[src]
fn mul(self, rhs: PublicKey) -> PublicKey
Performs the *
operation.
impl Neg for SecretKey
[src]
impl Neg for SecretKey
type Output = SecretKey
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
fn neg(self) -> Self::Output
Performs the unary -
operation.
impl From<SecretKey> for Message
[src]
impl From<SecretKey> for Message