BiometricAuthenticator

Trait BiometricAuthenticator 

Source
pub trait BiometricAuthenticator {
    // Required methods
    fn check_fingerprint_support<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_friendly_name<'life0, 'async_trait>(
        &'life0 mut self,
        friendly_name: String,
    ) -> Pin<Box<dyn Future<Output = Result<String, WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_fingerprint_sensor_info<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<BioEnrollmentResponse, WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_fingerprints<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TemplateInfo>, WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn enroll_fingerprint<'life0, 'async_trait>(
        &'life0 mut self,
        timeout: Duration,
        friendly_name: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rename_fingerprint<'life0, 'async_trait>(
        &'life0 mut self,
        id: Vec<u8>,
        friendly_name: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_fingerprint<'life0, 'async_trait>(
        &'life0 mut self,
        id: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_fingerprints<'life0, 'async_trait>(
        &'life0 mut self,
        ids: Vec<Vec<u8>>,
    ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on (crate features ctap2) and (crate features ctap2-management) only.
Expand description

Biometric management commands for Ctap21Authenticator and Ctap21PreAuthenticator.

Required Methods§

Source

fn check_fingerprint_support<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks that the device supports fingerprints.

Returns WebauthnCError::NotSupported if the token does not support fingerprint authentication.

Source

fn check_friendly_name<'life0, 'async_trait>( &'life0 mut self, friendly_name: String, ) -> Pin<Box<dyn Future<Output = Result<String, WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks that a given friendly_name complies with authenticator limits, and returns the value in Unicode Normal Form C.

Returns WebauthnCError::FriendlyNameTooLong if it does not comply with limits.

Source

fn get_fingerprint_sensor_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<BioEnrollmentResponse, WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets information about the token’s fingerprint sensor.

Returns WebauthnCError::NotSupported if the token does not support fingerprint authentication.

Source

fn list_fingerprints<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<TemplateInfo>, WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists all enrolled fingerprints in the device.

Returns an empty Vec if no fingerprints have been enrolled.

Returns WebauthnCError::NotSupported if the token does not support fingerprint authentication.

Source

fn enroll_fingerprint<'life0, 'async_trait>( &'life0 mut self, timeout: Duration, friendly_name: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Enrolls a fingerprint with the token.

This generally takes multiple user interactions (touches or swipes) of the sensor.

If enrollment is successful, returns the fingerprint ID.

Returns WebauthnCError::NotSupported if the token does not support fingerprint authentication.

Source

fn rename_fingerprint<'life0, 'async_trait>( &'life0 mut self, id: Vec<u8>, friendly_name: String, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Renames an enrolled fingerprint.

Source

fn remove_fingerprint<'life0, 'async_trait>( &'life0 mut self, id: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes an enrolled fingerprint.

Source

fn remove_fingerprints<'life0, 'async_trait>( &'life0 mut self, ids: Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes multiple enrolled fingerprints.

Warning: this is not an atomic operation. If any command fails, further processing will stop, and the request may be incomplete. Call Self::list_fingerprints to check what was actually done.

Implementors§

Source§

impl<'a, K, T, U, R> BiometricAuthenticator for T
where K: Token, T: BiometricAuthenticatorInfo<U, RequestType = R> + Deref<Target = Ctap20Authenticator<'a, K, U>> + DerefMut<Target = Ctap20Authenticator<'a, K, U>>, U: UiCallback + 'a, R: BioEnrollmentRequestTrait,

Implementation of biometric management commands for Ctap21Authenticator and Ctap21PreAuthenticator.