pub trait Sign:
Send
+ Sync
+ Debug {
// Required methods
fn key_id(&self) -> SigningKeyId;
fn sign(&self, payload: &[u8]) -> Result<Signature, SignError>;
}Expand description
Whatever can produce a signature for a key it holds.
The seam the open key-management question lives behind. An in-process key, an agent socket, a cloud KMS, and a hardware token differ in where the private bytes are and how a signature is requested; none of that is visible to a checker, which asks for a signature and gets one or does not commit.
Required Methods§
Sourcefn key_id(&self) -> SigningKeyId
fn key_id(&self) -> SigningKeyId
Which key this signs with.
Recorded in every piece of evidence, so a verifier knows what to check against without being handed the key material.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".