pub trait Signer:
Send
+ Sync
+ 'static {
// Required methods
fn sig_type(&self) -> SignatureType;
fn key_name(&self) -> &Name;
fn sign<'a>(
&'a self,
region: &'a [u8],
) -> Pin<Box<dyn Future<Output = Result<Bytes, TrustError>> + Send + 'a>>;
// Provided methods
fn cert_name(&self) -> Option<&Name> { ... }
fn public_key(&self) -> Option<Bytes> { ... }
fn sign_sync(&self, region: &[u8]) -> Result<Bytes, TrustError> { ... }
}Expand description
Signs a region of bytes and produces a signature value.
Implemented as a dyn-compatible trait using BoxFuture so it can be stored
as Arc<dyn Signer> in the key store.
Required Methods§
fn sig_type(&self) -> SignatureType
fn key_name(&self) -> &Name
fn sign<'a>( &'a self, region: &'a [u8], ) -> Pin<Box<dyn Future<Output = Result<Bytes, TrustError>> + Send + 'a>>
Provided Methods§
Sourcefn cert_name(&self) -> Option<&Name>
fn cert_name(&self) -> Option<&Name>
The certificate name to embed as a key locator in SignatureInfo, if any.
Sourcefn public_key(&self) -> Option<Bytes>
fn public_key(&self) -> Option<Bytes>
Return the raw public key bytes, if available.
Sourcefn sign_sync(&self, region: &[u8]) -> Result<Bytes, TrustError>
fn sign_sync(&self, region: &[u8]) -> Result<Bytes, TrustError>
Synchronous signing — avoids Box::pin and async state machine overhead.
Signers whose work is pure CPU (Ed25519, HMAC) should override this.