apple-localauthentication 0.3.3

Safe Rust bindings for Apple's LocalAuthentication framework — contexts, rights, persisted secrets, keys, and credentials on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use localauthentication::ffi;
use localauthentication::prelude::*;

fn main() {
    let errors = [
        LAError::from_code_message(ffi::la_error::BIOMETRY_LOCKOUT, "biometry locked"),
        LAError::from_code_message(ffi::la_error::COMPANION_NOT_AVAILABLE, "companion missing"),
        LAError::from_code_message(ffi::status::BRIDGE_FAILED, "bridge failed"),
    ];

    println!("domain: {LA_ERROR_DOMAIN}");
    for error in errors {
        println!("{error:?} => {error}");
    }
    println!("✅ error mapping OK");
}