Struct passkey_authenticator::Authenticator
source · pub struct Authenticator<S, U> { /* private fields */ }Expand description
A virtual authenticator with all the necessary state and information.
Implementations§
source§impl<S, U> Authenticator<S, U>where
S: CredentialStore + Sync,
U: UserValidationMethod + Sync,
Passkey: TryFrom<<S as CredentialStore>::PasskeyItem>,
impl<S, U> Authenticator<S, U>where
S: CredentialStore + Sync,
U: UserValidationMethod + Sync,
Passkey: TryFrom<<S as CredentialStore>::PasskeyItem>,
sourcepub async fn get_assertion(
&self,
input: Request
) -> Result<Response, StatusCode>
pub async fn get_assertion( &self, input: Request ) -> Result<Response, StatusCode>
This method is used by a host to request cryptographic proof of user authentication as well as user consent to a given transaction, using a previously generated credential that is bound to the authenticator and relying party identifier.
source§impl<S: CredentialStore, U: UserValidationMethod> Authenticator<S, U>
impl<S: CredentialStore, U: UserValidationMethod> Authenticator<S, U>
source§impl<S, U> Authenticator<S, U>
impl<S, U> Authenticator<S, U>
sourcepub async fn make_credential(
&mut self,
input: Request
) -> Result<Response, StatusCode>
pub async fn make_credential( &mut self, input: Request ) -> Result<Response, StatusCode>
This method is invoked by the host to request generation of a new credential in the authenticator.
source§impl<S, U> Authenticator<S, U>where
S: CredentialStore,
U: UserValidationMethod,
impl<S, U> Authenticator<S, U>where
S: CredentialStore,
U: UserValidationMethod,
sourcepub fn new(aaguid: Aaguid, store: S, user: U) -> Self
pub fn new(aaguid: Aaguid, store: S, user: U) -> Self
Create an authenticator with a known aaguid, a backing storage and a User verification system.
sourcepub fn set_display_name(&mut self, name: String)
pub fn set_display_name(&mut self, name: String)
Set the authenticator’s display name which will be returned if webauthn::CredentialPropertiesOutput is requested.
sourcepub fn display_name(&self) -> Option<&String>
pub fn display_name(&self) -> Option<&String>
Get a reference to the authenticators display name to return in webauthn::CredentialPropertiesOutput.
sourcepub fn store(&self) -> &S
pub fn store(&self) -> &S
Access the CredentialStore to look into what is stored.
sourcepub fn store_mut(&mut self) -> &mut S
pub fn store_mut(&mut self) -> &mut S
Exclusively access the CredentialStore to look into what is stored and modify it if needed.
sourcepub fn attachment_type(&self) -> AuthenticatorAttachment
pub fn attachment_type(&self) -> AuthenticatorAttachment
Return the current attachment type for this authenticator.
sourcepub fn choose_algorithm(
&self,
params: &[PublicKeyCredentialParameters]
) -> Result<Algorithm, Ctap2Error>
pub fn choose_algorithm( &self, params: &[PublicKeyCredentialParameters] ) -> Result<Algorithm, Ctap2Error>
Validate params with the following steps
1. For each element of params:
1-2: Handled during deserialization
3. If the element specifies an algorithm that is supported by the authenticator, and
no algorithm has yet been chosen by this loop, then let the algorithm specified by
the current element be the chosen algorithm.
2. If the loop completes and no algorithm was chosen then return Ctap2Error::UnsupportedAlgorithm.
Note: This loop chooses the first occurrence of an algorithm identifier supported by this
authenticator but always iterates over every element of params to validate them.
sourcepub fn transports(self, transports: Vec<AuthenticatorTransport>) -> Self
pub fn transports(self, transports: Vec<AuthenticatorTransport>) -> Self
Builder method for overwriting the authenticator’s supported transports.
Trait Implementations§
source§impl<S, U> Ctap2Api for Authenticator<S, U>
impl<S, U> Ctap2Api for Authenticator<S, U>
source§fn get_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§impl<S: CredentialStore + Sync + Send, U: UserValidationMethod + Sync + Send> U2fApi for Authenticator<S, U>
impl<S: CredentialStore + Sync + Send, U: UserValidationMethod + Sync + Send> U2fApi for Authenticator<S, U>
source§fn register<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: RegisterRequest,
handle: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<RegisterResponse, U2FError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: RegisterRequest,
handle: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<RegisterResponse, U2FError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Apply a register request and create a credential and respond with the public key of said credential.
source§fn authenticate<'life0, 'async_trait>(
&'life0 self,
request: AuthenticationRequest,
counter: u32,
user_presence: Flags
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResponse, U2FError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate<'life0, 'async_trait>(
&'life0 self,
request: AuthenticationRequest,
counter: u32,
user_presence: Flags
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResponse, U2FError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Apply an authentication request with the appropriate response