pub trait Signer {
fn set_header_params(&mut self, headers: HeadersMut<'_>) -> Result<()>;
fn compute_mac(
&mut self,
encoded_protected_header: &[u8],
encoded_payload: &[u8]
) -> Result<Vec<u8>>;
fn sign(
&mut self,
headers: HeadersMut<'_>,
encoded_protected_header: &[u8],
encoded_payload: &[u8]
) -> Result<Vec<u8>> { ... }
}
Expand description
A signer for JWS messages.
Required Methods
sourcefn set_header_params(&mut self, headers: HeadersMut<'_>) -> Result<()>
fn set_header_params(&mut self, headers: HeadersMut<'_>) -> Result<()>
Set the header parameters to indicate how the message should be verified.
This is the first step in the signing process, since the encoded headers will end up in the signature if they are added to the protected header.
Provided Methods
sourcefn sign(
&mut self,
headers: HeadersMut<'_>,
encoded_protected_header: &[u8],
encoded_payload: &[u8]
) -> Result<Vec<u8>>
fn sign(
&mut self,
headers: HeadersMut<'_>,
encoded_protected_header: &[u8],
encoded_payload: &[u8]
) -> Result<Vec<u8>>
Sign a message.
This is a shorthand for calling set_header_params
followed by compute_mac
.