pub trait SigningKey: AgentKey {
// Required methods
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn recommended_jws_alg(&self) -> JwsAlgorithm;
fn create_jws<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
protected_header: Option<JwsProtected>,
) -> Pin<Box<dyn Future<Output = Result<Jws>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Agent key capable of signing data for JWS creation.
Implementations of this trait can sign data to create JWS signatures.
Required Methods§
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs the provided data using this key
Sourcefn recommended_jws_alg(&self) -> JwsAlgorithm
fn recommended_jws_alg(&self) -> JwsAlgorithm
Returns the recommended JWS algorithm for this key
Sourcefn create_jws<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
protected_header: Option<JwsProtected>,
) -> Pin<Box<dyn Future<Output = Result<Jws>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_jws<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
protected_header: Option<JwsProtected>,
) -> Pin<Box<dyn Future<Output = Result<Jws>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs and creates a JWS with the provided payload