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§
- Biometric
Config - Configuration for biometric authentication
Enums§
- Auth
Result - 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