Skip to main content

soft_fido2_transport/
lib.rs

1//! Pure Rust CTAP Transport Layer
2//!
3//! This crate provides transport implementations for CTAP (Client to Authenticator Protocol):
4//! - CTAP HID protocol (message framing, fragmentation, reassembly)
5//! - Channel management (CID allocation, message assembly, timeouts)
6//! - Command handler abstraction for processing CTAP messages
7//! - USB HID transport (via hidapi) - requires "usb" feature
8//! - Linux UHID virtual device support (for testing)
9//!
10//! # Features
11//!
12//! - `usb`: Enable USB HID transport (requires libudev on Linux)
13//! - `uhid`: Enable Linux UHID virtual device support (Linux only)
14//!
15//! Spec: <https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html#usb>
16
17pub mod channel;
18pub mod ctaphid;
19pub mod error;
20pub mod handler;
21#[cfg(feature = "usb")]
22pub mod runner;
23#[cfg(target_os = "linux")]
24pub mod uhid;
25#[cfg(feature = "usb")]
26pub mod usb;
27
28// Re-export commonly used types
29pub use channel::ChannelManager;
30pub use ctaphid::{Cmd, Message, Packet};
31pub use error::{Error, Result};
32pub use handler::{CommandHandler, CtapHidHandler};
33#[cfg(feature = "usb")]
34pub use runner::AuthenticatorRunner;
35#[cfg(target_os = "linux")]
36pub use uhid::UhidDevice;
37#[cfg(feature = "usb")]
38pub use usb::{UsbDeviceInfo, UsbTransport, enumerate_devices, init_usb};