Crates.io | fido2-rs |
lib.rs | fido2-rs |
version | 0.3.0 |
source | src |
created_at | 2023-01-07 17:58:31.845768 |
updated_at | 2024-11-01 19:10:54.502242 |
description | Rust bindings to Yubico fido2 |
homepage | |
repository | https://github.com/tyan-boot/fido-rs |
max_upload_size | |
id | 753165 |
size | 89,987 |
libfido2 bindings for the Rust programming language.
For more details, see tyan-boot/fido-rs
use fido2_rs::device::Device;
use fido2_rs::credentials::Credential;
use fido2_rs::credentials::CoseType;
use anyhow::Result;
fn main() -> Result<()> {
let dev = Device::open("windows://hello").expect("unable open windows hello");
let mut cred = Credential::new();
cred.set_client_data(&[1, 2, 3, 4, 5, 6])?;
cred.set_rp("fido_rs", "fido example")?;
cred.set_user(&[1, 2, 3, 4, 5, 6], "alice", Some("alice"), None)?;
cred.set_cose_type(CoseType::RS256)?;
let _ = dev.make_credential(&mut cred, None)?;
dbg!(cred.id());
Ok(())
}