pub trait Signature {
// Required methods
fn generate_keypair(&self) -> Result<SigKeypair>;
fn sign(&self, secret_key: &SigSecretKey, message: &[u8]) -> Result<Vec<u8>>;
fn verify(
&self,
public_key: &SigPublicKey,
message: &[u8],
signature: &[u8],
) -> Result<bool>;
}Expand description
Trait for digital signatures
Required Methods§
Sourcefn generate_keypair(&self) -> Result<SigKeypair>
fn generate_keypair(&self) -> Result<SigKeypair>
Generate a keypair
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".