Trait Signer
Source pub trait Signer:
Debug
+ Send
+ Sync {
// Required methods
fn sign(&self, data: &[u8]) -> Signature;
fn public_key(&self) -> PublicKey<'_>;
}
Expand description
A Signer provides the ability to generate a Signature for provided
payload data.
This abstraction decouples the caller from the underlying key type and
storage.
Note that the key material used by a Signer instance MUST NOT change for
the lifetime of the Signer instance.
Sign data with this private key.
Signatures are non-deterministic and rely on randomness on the host.
Obtain the PublicKey for this Signer.
Invariant: from the caller’s perspective, a single Signer instance
always returns the same PublicKey (key material).
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".