[][src]Struct bls_eth_rust::SecretKey

#[repr(C)]
pub struct SecretKey { /* fields omitted */ }

secret key type

Methods

impl SecretKey[src]

pub fn zero() -> SecretKey[src]

return zero instance

pub unsafe fn uninit() -> SecretKey[src]

return uninitialized instance

impl SecretKey[src]

pub fn deserialize(&mut self, buf: &[u8]) -> bool[src]

return true if buf is deserialized successfully

  • buf - serialized data by serialize

pub fn from_serialized(buf: &[u8]) -> Result<SecretKey, BlsError>[src]

return deserialized buf

pub fn serialize(&self) -> Vec<u8>[src]

return serialized byte array

pub fn as_bytes(&self) -> Vec<u8>[src]

alias of serialize

impl SecretKey[src]

pub fn set_by_csprng(&mut self)[src]

init secret key by CSPRNG

pub fn set_hex_str(&mut self, s: &str) -> bool[src]

set hexadecimal string s to self

pub fn from_hex_str(s: &str) -> Result<SecretKey, BlsError>[src]

return the secret key set by hexadecimal string s

pub fn get_publickey(&self) -> PublicKey[src]

return the public key corresponding to self

pub fn sign_message(&self, msg: &Message) -> Result<Signature, BlsError>[src]

not used in eth2.0

pub fn sign(&self, msg: &[u8]) -> Signature[src]

return the signature of msg

  • msg - message

Trait Implementations

impl Clone for SecretKey[src]

impl Copy for SecretKey[src]

impl Debug for SecretKey[src]

impl Default for SecretKey[src]

impl Eq for SecretKey[src]

impl PartialEq<SecretKey> for SecretKey[src]

fn eq(&self, rhs: &Self) -> bool[src]

return true if self is equal to rhs

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.