pub trait Signer: Send + Sync {
// Required methods
fn alg(&self) -> JwsAlgorithm;
fn kid(&self) -> Option<&str>;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
signing_input: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Produces JWS signatures.
A signer binds one key and one algorithm. Private keys live behind it, in a key store, an HSM
or a cloud service, which is why signing is async. The signature is returned in the JWS form
of the algorithm: raw r || s for ECDSA, never DER.
Required Methods§
Sourcefn alg(&self) -> JwsAlgorithm
fn alg(&self) -> JwsAlgorithm
The algorithm every signature of this signer uses.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".