Trait jws::Signer

source ·
pub trait Signer {
    // Required methods
    fn set_header_params(&self, header: &mut JsonObject);
    fn compute_mac(
        &self,
        encoded_protected_header: &[u8],
        encoded_payload: &[u8]
    ) -> Result<Vec<u8>>;
}
Expand description

A signer for JWS messages.

Required Methods§

source

fn set_header_params(&self, header: &mut JsonObject)

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.

source

fn compute_mac( &self, encoded_protected_header: &[u8], encoded_payload: &[u8] ) -> Result<Vec<u8>>

Compute the Message Authentication Code for the encoded protected header and encoded payload.

The returned MAC must be plain bytes, not hex or base64 encoded.

Implementors§