pub trait Signer:
Debug
+ Send
+ Sync {
// Required methods
fn sign(&self, message: &[u8]) -> Result<Vec<u8>, Error>;
fn scheme(&self) -> SignatureScheme;
}
Expand description
A thing that can sign a message.
Required Methods§
sourcefn sign(&self, message: &[u8]) -> Result<Vec<u8>, Error>
fn sign(&self, message: &[u8]) -> Result<Vec<u8>, Error>
Signs message
using the selected scheme.
message
is not hashed; the implementer must hash it using the hash function
implicit in Self::scheme()
.
The returned signature format is also defined by Self::scheme()
.
sourcefn scheme(&self) -> SignatureScheme
fn scheme(&self) -> SignatureScheme
Reveals which scheme will be used when you call Self::sign()
.