Skip to main content

localauthentication/
lib.rs

1#![doc = include_str!("../README.md")]
2//!
3//! ---
4//!
5//! # API documentation
6//!
7//! Safe Rust bindings for Apple's `LocalAuthentication.framework` on macOS.
8
9#![cfg_attr(docsrs, feature(doc_cfg))]
10
11pub mod context;
12pub mod error;
13pub mod ffi;
14pub mod la_authentication_requirement;
15pub mod la_context;
16pub mod la_credential;
17pub mod la_environment;
18pub mod la_error;
19pub mod la_persisted_right;
20pub mod la_policy;
21pub mod la_public_key;
22pub mod la_right;
23pub mod la_right_store;
24mod private;
25
26#[cfg(feature = "async")]
27pub mod async_api;
28
29pub use la_authentication_requirement::{
30    LAAuthenticationRequirement, LABiometryFallbackRequirement,
31};
32pub use la_context::{
33    BiometryType, LAAccessControlOperation, LACompanionType, LAContext, LADomainState,
34    LADomainStateBiometry, LADomainStateCompanion,
35};
36pub use la_credential::{LACredential, LACredentialType};
37pub use la_environment::{
38    LAEnvironment, LAEnvironmentMechanism, LAEnvironmentMechanismBiometry,
39    LAEnvironmentMechanismCompanion, LAEnvironmentMechanismUserPassword,
40    LAEnvironmentObserver, LAEnvironmentObserverRegistration, LAEnvironmentState,
41};
42pub use la_error::{LAError, LocalAuthenticationError, Result, LA_ERROR_DOMAIN};
43pub use la_persisted_right::{LAPersistedRight, LAPrivateKey, LASecret};
44pub use la_policy::{LAPolicy, Policy};
45pub use la_public_key::{LAPublicKey, SecKeyAlgorithm, SecKeyExchangeParameters};
46pub use la_right::{LARight, LARightState};
47pub use la_right_store::LARightStore;
48
49/// Common imports for users of this crate.
50pub mod prelude {
51    pub use crate::la_authentication_requirement::{
52        LAAuthenticationRequirement, LABiometryFallbackRequirement,
53    };
54    pub use crate::la_context::{
55        BiometryType, LAAccessControlOperation, LACompanionType, LAContext, LADomainState,
56        LADomainStateBiometry, LADomainStateCompanion,
57    };
58    pub use crate::la_credential::{LACredential, LACredentialType};
59    pub use crate::la_environment::{
60        LAEnvironment, LAEnvironmentMechanism, LAEnvironmentMechanismBiometry,
61        LAEnvironmentMechanismCompanion, LAEnvironmentMechanismUserPassword,
62        LAEnvironmentObserver, LAEnvironmentObserverRegistration, LAEnvironmentState,
63    };
64    pub use crate::la_error::{LAError, LocalAuthenticationError, Result, LA_ERROR_DOMAIN};
65    pub use crate::la_persisted_right::{LAPersistedRight, LAPrivateKey, LASecret};
66    pub use crate::la_policy::{LAPolicy, Policy};
67    pub use crate::la_public_key::{LAPublicKey, SecKeyAlgorithm, SecKeyExchangeParameters};
68    pub use crate::la_right::{LARight, LARightState};
69    pub use crate::la_right_store::LARightStore;
70}