Skip to main content

PasskeyHost

Trait PasskeyHost 

Source
pub trait PasskeyHost:
    Send
    + Sync
    + 'static {
    // Required methods
    fn availability(&self) -> Result<PasskeyAvailability, PasskeyError>;
    fn register(
        &self,
        request: PasskeyRegistrationRequest,
    ) -> Result<PasskeyRegistrationResult, PasskeyError>;
    fn authenticate(
        &self,
        request: PasskeyAuthenticationRequest,
    ) -> Result<PasskeyAuthenticationResult, PasskeyError>;
    fn cancel(&self) -> Result<(), PasskeyError>;
}
Expand description

Host-side passkey/WebAuthn provider used by shell capability registration.

Required Methods§

Source

fn availability(&self) -> Result<PasskeyAvailability, PasskeyError>

Returns passkey support for the current host, origin, and credential backend.

Source

fn register( &self, request: PasskeyRegistrationRequest, ) -> Result<PasskeyRegistrationResult, PasskeyError>

Starts passkey registration and returns WebAuthn registration data.

request contains the relying-party identity, user handle, challenge, requested algorithms, and authenticator preferences. The returned payload must be sent to the relying-party server for verification before the app treats the passkey as enrolled.

Source

fn authenticate( &self, request: PasskeyAuthenticationRequest, ) -> Result<PasskeyAuthenticationResult, PasskeyError>

Starts passkey authentication and returns WebAuthn assertion data.

request.challenge must originate from the server. The returned assertion proves nothing until the server verifies the challenge, signature, authenticator data, and credential id against the account.

Source

fn cancel(&self) -> Result<(), PasskeyError>

Cancels an active passkey prompt where the host allows cancellation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§