fido2-rs

Crates.iofido2-rs
lib.rsfido2-rs
version0.3.0
sourcesrc
created_at2023-01-07 17:58:31.845768
updated_at2024-11-01 19:10:54.502242
descriptionRust bindings to Yubico fido2
homepage
repositoryhttps://github.com/tyan-boot/fido-rs
max_upload_size
id753165
size89,987
Tyan (tyan-boot)

documentation

README

fido2-rs

crates.io MIT

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(())
}
Commit count: 37

cargo fmt