pub struct Keys {
pub sk: SecretKey,
pub pk: PublicKey,
}
Expand description
Fields§
§sk: SecretKey
The secret key.
pk: PublicKey
The public key.
Implementations§
Source§impl Keys
impl Keys
Sourcepub fn verify_domain(
&self,
domain: Domain,
sig: &Signature,
msg: &[u8],
) -> Result<(), Error>
pub fn verify_domain( &self, domain: Domain, sig: &Signature, msg: &[u8], ) -> Result<(), Error>
Verify a message in a particular domain.
Sourcepub fn sign_domain(&self, domain: Domain, msg: &[u8]) -> Signature
pub fn sign_domain(&self, domain: Domain, msg: &[u8]) -> Signature
Sign a message for a particular domain, with a derived nonce.
Sourcepub fn verify(&self, sig: &Signature, msg: &[u8]) -> Result<(), Error>
pub fn verify(&self, sig: &Signature, msg: &[u8]) -> Result<(), Error>
Verify a message in the default domain.
Sourcepub fn sign_nonce(
&self,
domain: Domain,
nonce: &[u8; 32],
msg: &[u8],
) -> Signature
pub fn sign_nonce( &self, domain: Domain, nonce: &[u8; 32], msg: &[u8], ) -> Signature
Sign a message for a particular domain, with the supplied secret nonce.
If you really want randomized signatures, this is the function to use. Make sure you have a really solid random number generator making these nonces!
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keys
impl RefUnwindSafe for Keys
impl Send for Keys
impl Sync for Keys
impl Unpin for Keys
impl UnwindSafe for Keys
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