Trait jwt_compact_preview::AlgorithmSignature[][src]

pub trait AlgorithmSignature: Sized {
    fn try_from_slice(slice: &[u8]) -> Result<Self>;
fn as_bytes(&self) -> Cow<'_, [u8]>; }

Signature for a certain JWT signing Algorithm.

We require that signature can be restored from a byte slice, and can be represented as a byte slice.

Required methods

fn try_from_slice(slice: &[u8]) -> Result<Self>[src]

Attempts to restore a signature from a byte slice. This method may fail if the slice is malformed (e.g., has a wrong length).

fn as_bytes(&self) -> Cow<'_, [u8]>[src]

Represents this signature as bytes.

Loading content...

Implementations on Foreign Types

impl AlgorithmSignature for Signature[src]

impl AlgorithmSignature for Output<Hmac<Sha256>>[src]

impl AlgorithmSignature for Output<Hmac<Sha384>>[src]

impl AlgorithmSignature for Output<Hmac<Sha512>>[src]

impl AlgorithmSignature for Signature[src]

Loading content...

Implementors

Loading content...