pub struct SecretKey { /* private fields */ }Expand description
secret key type
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn set_by_csprng(&mut self)
pub fn set_by_csprng(&mut self)
init secret key by CSPRNG
Sourcepub fn set_hex_str(&mut self, s: &str) -> bool
pub fn set_hex_str(&mut self, s: &str) -> bool
set hexadecimal string s to self
Sourcepub fn from_hex_str(s: &str) -> Result<SecretKey, BlsError>
pub fn from_hex_str(s: &str) -> Result<SecretKey, BlsError>
return the secret key set by hexadecimal string s
Sourcepub fn get_public_key(&self) -> G2
pub fn get_public_key(&self) -> G2
return the public key corresponding to self
Sourcepub fn deserialize(&mut self, buf: &[u8]) -> bool
pub fn deserialize(&mut self, buf: &[u8]) -> bool
return true if buf is deserialized successfully
buf- serialized data byserialize
Sourcepub fn from_serialized(buf: &[u8]) -> Result<Self, BlsError>
pub fn from_serialized(buf: &[u8]) -> Result<Self, BlsError>
return deserialized buf
pub fn is_zero(&self) -> bool
pub fn is_valid(&self) -> bool
Trait Implementations§
impl Copy for SecretKey
impl Eq for SecretKey
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnsafeUnpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more