pub struct SecretKey(/* private fields */);
Expand description
A secret key.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn from_slice(sk: &[u8]) -> Result<Self, Error>
pub fn from_slice(sk: &[u8]) -> Result<Self, Error>
Creates a secret key from a slice.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the public counterpart of a secret key.
Sourcepub fn validate_public_key(&self, pk: &PublicKey) -> Result<(), Error>
pub fn validate_public_key(&self, pk: &PublicKey) -> Result<(), Error>
Returns Ok(())
if the given public key is the public counterpart of
this secret key.
Returns Err(Error::InvalidPublicKey)
otherwise.
The public key is recomputed (not just copied) from the secret key,
so this will detect corruption of the secret key.
Source§impl SecretKey
impl SecretKey
Sourcepub fn sign_incremental(&self, noise: Noise) -> SigningState
pub fn sign_incremental(&self, noise: Noise) -> SigningState
Sign a multi-part message (streaming API).
It is critical for noise
to never repeat.
Trait Implementations§
impl Eq for SecretKey
impl StructuralPartialEq 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 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