Crate solana_keyring_biometric

Crate solana_keyring_biometric 

Source
Expand description

Biometric authentication library for macOS TouchID

This crate provides biometric authentication capabilities using macOS TouchID via the LocalAuthentication framework. On non-macOS platforms, authentication is a no-op that always succeeds.

§Example

use solana_keyring_biometric::{is_available, authenticate, AuthResult};

// Check if biometric authentication is available
if is_available() {
    // Request authentication with a reason
    match authenticate("Confirm your identity") {
        Ok(AuthResult::Authenticated) => println!("Success!"),
        Ok(AuthResult::Denied) => println!("Authentication denied"),
        Ok(AuthResult::NotAvailable) => println!("Biometrics not available"),
        Err(e) => eprintln!("Error: {}", e),
    }
}

Structs§

BiometricConfig
Configuration for biometric authentication

Enums§

AuthResult
Result of an authentication attempt
Error
Errors that can occur during biometric authentication

Functions§

authenticate
authenticate_with_config
confirm_signing
Request confirmation for a signing operation
confirm_signing_with_config
Request confirmation with custom configuration.
is_available
is_passcode_available

Type Aliases§

Result
Result type for biometric operations