1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (C) 2026 Qualia2FA contributors
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3 of the License, or (at your option) any
// later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, see <https://www.gnu.org/licenses/>.
//! Platform backends.
//!
//! Each backend lives behind its own `cfg`, so a build for one platform does not
//! compile another platform's FFI. The common trait is in [`crate::traits`].
//!
//! # Current state
//!
//! - `windows`: Windows Hello through the Win32 WebAuthn `hmac-secret` extension.
//! - [`stub`]: the honest "this build cannot do it" backend, used everywhere a real
//! backend is not wired yet.
//! - Android Keystore is planned. Its design is fixed by the rule that the
//! **platform** must release the key: a prompt whose success is only checked in
//! user-mode is not a backend.
//!
//! A platform without a backend must report [`crate::Availability::Unsupported`],
//! never a software key that pretends to be protected.
use crateAuthBoundKeyStore;
/// Opens the best auth-bound store this build has for the current platform.
///
/// The returned value always exists; ask [`AuthBoundKeyStore::availability`] before
/// offering the platform-authentication path. On a platform without a backend this is
/// [`stub::UnsupportedKeyStore`], which reports the truth and refuses every operation.
///
/// The store holds no credential until it is used, so calling this at startup does not
/// prompt and does not touch the platform.