Skip to main content

VerifyConfig

Struct VerifyConfig 

Source
pub struct VerifyConfig {
    pub now: Option<u64>,
    pub leeway: u64,
    pub label: Option<String>,
    pub required_components: Vec<Component>,
    pub max_age: Option<u64>,
    pub wimse_profile: bool,
    pub expected_audience: Option<String>,
    pub wimse_response_profile: bool,
    pub expected_req_nonce: Option<String>,
}
Expand description

Options controlling verify.

A bare successful verify proves only that some set of components was signed with the key. To bind the request, set required_components to the components that must be covered — under the WIMSE profile that is @method and @request-target, plus content-type, content-digest, authorization, txn-token and workload-identity-token whenever the message carries them.

Fields§

§now: Option<u64>

The current time, in seconds since the Unix epoch. When set, created and expires are checked against it.

§leeway: u64

Clock-skew tolerance, in seconds.

§label: Option<String>

If set, only this signature label is accepted.

§required_components: Vec<Component>

Components that MUST be covered by the signature; verification fails if any is absent.

§max_age: Option<u64>

If set (together with now), the signature’s created must be present and within this many seconds of now.

§wimse_profile: bool

Enforce the WIMSE request-signature profile on the received parameters: created, expires, nonce, tag and wimse-aud must all be present, tag must be WIMSE_TAG, and keyid and alg must be absent.

Off by default so the crate can also be driven as a plain RFC 9421 implementation.

§expected_audience: Option<String>

If set, the signature’s wimse-aud must equal this value. A signature is only bound to this service if the audience it names is checked.

§wimse_response_profile: bool

Enforce the WIMSE response-signature profile instead of the request one: same mandatory parameters, but wimse-aud is a request-only parameter and wimse-req-nonce is required whenever the client demanded a signed response.

Whether it was demanded is taken from expected_req_nonce being set, since the client that sent the request is the only party that knows, and it is also the only party that can check the returned value.

§expected_req_nonce: Option<String>

If set, the response’s wimse-req-nonce must equal this value — the nonce the client put on its own request. Checking it is what stops a response signed for one request being replayed against another.

Trait Implementations§

Source§

impl Clone for VerifyConfig

Source§

fn clone(&self) -> VerifyConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VerifyConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VerifyConfig

Source§

fn default() -> VerifyConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.