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
impl DiscoverableAuthenticationServerState
Sourcepub 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>
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
impl Borrow<SentChallenge> for DiscoverableAuthenticationServerState
Source§fn borrow(&self) -> &SentChallenge
fn borrow(&self) -> &SentChallenge
Source§impl Decode for DiscoverableAuthenticationServerState
Available on crate feature serializable_server_state only.
impl Decode for DiscoverableAuthenticationServerState
serializable_server_state only.Source§impl Encode for DiscoverableAuthenticationServerState
Available on crate feature serializable_server_state only.
impl Encode for DiscoverableAuthenticationServerState
serializable_server_state only.impl Eq for DiscoverableAuthenticationServerState
Source§impl Ord for DiscoverableAuthenticationServerState
impl Ord for DiscoverableAuthenticationServerState
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq<&DiscoverableAuthenticationServerState> for DiscoverableAuthenticationServerState
impl PartialEq<&DiscoverableAuthenticationServerState> for DiscoverableAuthenticationServerState
Source§impl PartialEq<DiscoverableAuthenticationServerState> for &DiscoverableAuthenticationServerState
impl PartialEq<DiscoverableAuthenticationServerState> for &DiscoverableAuthenticationServerState
Source§impl PartialOrd for DiscoverableAuthenticationServerState
impl PartialOrd for DiscoverableAuthenticationServerState
Source§impl TimedCeremony for DiscoverableAuthenticationServerState
impl TimedCeremony for DiscoverableAuthenticationServerState
Source§fn expiration(&self) -> Instant
fn expiration(&self) -> Instant
Instant the ceremony expires. Read more