Skip to main content

DiscoverableAuthenticationServerState

Struct DiscoverableAuthenticationServerState 

Source
pub struct DiscoverableAuthenticationServerState(/* private fields */);
Expand description

State needed to be saved when beginning the authentication ceremony.

Saves the necessary information associated with the DiscoverableCredentialRequestOptions used to create it via DiscoverableCredentialRequestOptions::start_ceremony so that authentication of a credential can be performed with Self::verify.

DiscoverableAuthenticationServerState implements Borrow of SentChallenge; thus to obtain the correct DiscoverableAuthenticationServerState associated with a DiscoverableAuthentication, one should use its corresponding DiscoverableAuthentication::challenge.

Implementations§

Source§

impl DiscoverableAuthenticationServerState

Source

pub fn verify<'a, const USER_LEN: usize, O: PartialEq<Origin<'a>>, T: PartialEq<Origin<'a>>, MlDsa87Key: AsRef<[u8]>, MlDsa65Key: AsRef<[u8]>, MlDsa44Key: AsRef<[u8]>, EdKey: AsRef<[u8]>, P256Key: AsRef<[u8]>, P384Key: AsRef<[u8]>, RsaKey: AsRef<[u8]>>( self, rp_id: &RpId, response: &'a DiscoverableAuthentication<USER_LEN>, cred: &mut AuthenticatedCredential<'_, '_, USER_LEN, CompressedPubKey<MlDsa87Key, MlDsa65Key, MlDsa44Key, EdKey, P256Key, P384Key, RsaKey>>, options: &AuthenticationVerificationOptions<'_, '_, O, T>, ) -> Result<bool, AuthCeremonyErr>

Verifies response is valid based on self consuming self and updating cred. Returns true iff cred was mutated.

rp_id MUST be the same as the PublicKeyCredentialRequestOptions::rp_id used when starting the ceremony.

It is essential to save AuthenticatedCredential::dynamic_state overwriting the original value iff Ok(true) is returned.

§Errors

Errors iff response is not valid according to the authentication ceremony or violates any of the settings in options.

Trait Implementations§

Source§

impl Borrow<SentChallenge> for DiscoverableAuthenticationServerState

Source§

fn borrow(&self) -> &SentChallenge

Immutably borrows from an owned value. Read more
Source§

impl Debug for DiscoverableAuthenticationServerState

Source§

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

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

impl Decode for DiscoverableAuthenticationServerState

Available on crate feature serializable_server_state only.
Source§

type Input<'a> = &'a [u8]

Available on crate feature bin only.
“Primitive”-like input to be decoded. Read more
Source§

type Err = DecodeDiscoverableAuthenticationServerStateErr

Available on crate feature bin only.
Error returned when decoding fails.
Source§

fn decode(input: Self::Input<'_>) -> Result<Self, Self::Err>

Available on crate feature bin only.
Decodes input into Self. Note input must not have any trailing data. Read more
Source§

impl Encode for DiscoverableAuthenticationServerState

Available on crate feature serializable_server_state only.
Source§

type Output<'a> = Vec<u8> where Self: 'a

Available on crate feature bin only.
“Primitive”-like type that self will be converted into. This should be one of the following: Read more
Source§

type Err = SystemTimeError

Available on crate feature bin only.
Error returned when encoding fails.
Source§

fn encode(&self) -> Result<Self::Output<'_>, Self::Err>

Available on crate feature bin only.
Transforms self into a “primitive”-like type. Read more
Source§

impl Eq for DiscoverableAuthenticationServerState

Source§

impl Hash for DiscoverableAuthenticationServerState

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for DiscoverableAuthenticationServerState

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for DiscoverableAuthenticationServerState

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<&DiscoverableAuthenticationServerState> for DiscoverableAuthenticationServerState

Source§

fn eq(&self, other: &&Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<DiscoverableAuthenticationServerState> for &DiscoverableAuthenticationServerState

Source§

fn eq(&self, other: &DiscoverableAuthenticationServerState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for DiscoverableAuthenticationServerState

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TimedCeremony for DiscoverableAuthenticationServerState

Source§

fn expiration(&self) -> Instant

Returns the Instant the ceremony expires. 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.