Struct libsecp256k1_rs::SecretKey [−][src]
pub struct SecretKey(_);
Secret key (256-bit) on a secp256k1 curve.
Methods
impl SecretKey[src]
impl SecretKeypub 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) -> StringReturn 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) -> SecretKeyCreate 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) -> SecretKeyTrait Implementations
impl Debug for SecretKey[src]
impl Debug for SecretKeyfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for SecretKey[src]
impl Clone for SecretKeyfn clone(&self) -> SecretKey[src]
fn clone(&self) -> SecretKeyReturns 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 SecretKeyimpl Eq for SecretKey[src]
impl Eq for SecretKeyimpl PartialEq for SecretKey[src]
impl PartialEq for SecretKeyfn eq(&self, other: &SecretKey) -> bool[src]
fn eq(&self, other: &SecretKey) -> boolThis 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) -> boolThis method tests for !=.
impl Display for SecretKey[src]
impl Display for SecretKeyfn 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 SecretKeyimpl Add for SecretKey[src]
impl Add for SecretKeytype Output = SecretKey
The resulting type after applying the + operator.
fn add(self, rhs: SecretKey) -> Self::Output[src]
fn add(self, rhs: SecretKey) -> Self::OutputPerforms the + operation.
impl Sub for SecretKey[src]
impl Sub for SecretKeytype Output = SecretKey
The resulting type after applying the - operator.
fn sub(self, rhs: SecretKey) -> SecretKey[src]
fn sub(self, rhs: SecretKey) -> SecretKeyPerforms the - operation.
impl Mul<SecretKey> for SecretKey[src]
impl Mul<SecretKey> for SecretKeytype Output = SecretKey
The resulting type after applying the * operator.
fn mul(self, rhs: SecretKey) -> SecretKey[src]
fn mul(self, rhs: SecretKey) -> SecretKeyPerforms the * operation.
impl Mul<PublicKey> for SecretKey[src]
impl Mul<PublicKey> for SecretKeytype Output = PublicKey
The resulting type after applying the * operator.
fn mul(self, rhs: PublicKey) -> PublicKey[src]
fn mul(self, rhs: PublicKey) -> PublicKeyPerforms the * operation.
impl Neg for SecretKey[src]
impl Neg for SecretKeytype Output = SecretKey
The resulting type after applying the - operator.
fn neg(self) -> Self::Output[src]
fn neg(self) -> Self::OutputPerforms the unary - operation.
impl From<SecretKey> for Message[src]
impl From<SecretKey> for Message