[−][src]Struct bls_eth_rust::SecretKey
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 byserialize
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]
Auto Trait Implementations
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,