[][src]Struct http_signature_normalization_http::verify::Unverified

pub struct Unverified { /* fields omitted */ }

The Unverified step of the verification process

This type is the result of performing some basic validation on the parsed header, and can be used to verify the header

Methods

impl Unverified[src]

pub fn key_id(&self) -> &str[src]

Get the Key ID from an Unverified type

This is useful for looking up the proper verification key to verify the request

pub fn algorithm(&self) -> Option<&Algorithm>[src]

Get the Algorithm used in the request, if one is present

If the algorithm is present and is not what an implementor expected, they should not attempt to verify the signature

pub fn verify<F, T>(&self, f: F) -> T where
    F: FnOnce(&str, &str) -> T, 
[src]

Verify the signature with the signature and the signing string

This example is not tested
unverified.verify(|signature, signing_string| {
    let bytes = match base64::decode(signature) {
        Ok(bytes) => bytes,
        Err(_) => return false,
    };

    public_key
        .verify(bytes, signing_string)
        .unwrap_or(false)
})

Trait Implementations

impl Debug for Unverified[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]