Skip to content

tyan-boot/fido-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fido-rs

libfido2 bindings for the Rust programming language.

Example

  1. Make a credential
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(())
}

Support platform

  • Windows (MSVC and MinGW)
  • Linux

TODO

  • more doc
  • full bindings to fido_cred_t and fido_assert_t

About

Safe bindings to libfido2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published