ctap-fido2
A CTAP2 client for FIDO2 over USB HID.
This crate allows one to enumerate HID authenticators, create credentials, run assertions, and read the hmac-secret extension.
On the TODO list is bio enrollment, credential management, large blobs, U2F, and PIN protocol v2.
Example
use ;
let info = list_devices?
.into_iter
.next
.expect;
let mut auth = open?;
let cdh = ;
let credential = auth.make_credential?;
// Persist `credential.id` and `credential.public_key.as_cose_bytes()` together.
let salt = ;
let secret = auth.get_hmac_secret?;
// `secret.0` is the 32-byte hmac-secret output, zeroized on drop.
# Ok::
Pass None for the PIN only on keys without one set.
Debugging
ctap-fido2 uses the log crate, so setting RUST_LOG=ctap_fido2=trace with any backend installed gets you frame-level
chatter.
Hardware
This crate has been tested against a YubiKey 5C, however any CTAP2.1 authenticator with hmac-secret should work.
License
ctap-fido2 is licensed under the MIT license.