[][src]Trait jws::Signer

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

A signer for JWS messages.

Required methods

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.

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.

Loading content...

Implementors

impl Signer for NoneSigner[src]

impl<K: AsRef<[u8]>> Signer for Hs256Signer<K>[src]

impl<K: AsRef<[u8]>> Signer for Hs384Signer<K>[src]

impl<K: AsRef<[u8]>> Signer for Hs512Signer<K>[src]

Loading content...