pub trait Sign {
// Required method
fn sign(&self, rng: &mut dyn RngCore, message: &[u8]) -> Result<Vec<u8>>;
}Expand description
Trait for types that can sign data.
This trait is implemented by all key types that support signing operations,
such as Ed25519Key and EcdsaP256Key. The sign method produces a
cryptographic signature of the message.
§Example
use rust_bottle::signing::Sign;
use rust_bottle::keys::Ed25519Key;
use rand::rngs::OsRng;
let rng = &mut OsRng;
let key = Ed25519Key::generate(rng);
let message = b"Test message";
let signature = key.sign(rng, message).unwrap();