Skip to content

Commit d81fe4e

Browse files
committed
add readme
1 parent cce524e commit d81fe4e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.MD

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# fido-rs
2+
3+
libfido2 bindings for the Rust programming language.
4+
5+
# Example
6+
7+
1. Make a credential
8+
```rust
9+
use fido2_rs::device::Device;
10+
use fido2_rs::credentials::CredentialRequest;
11+
use fido2_rs::credentials::CoseType;
12+
use anyhow::Result;
13+
14+
fn main() -> Result<()> {
15+
let dev = Device::open("windows://hello").expect("unable open windows hello");
16+
17+
let request = CredentialRequest::builder()
18+
.client_data(&[1, 2, 3, 4, 5, 6])?
19+
.rp("fido_rs", "fido example")?
20+
.user(&[1, 2, 3, 4, 5, 6], "alice", Some("alice"), None)?
21+
.cose_type(CoseType::RS256)?
22+
.build();
23+
let cred = dev.make_credential(request, None)?;
24+
dbg!(cred.id());
25+
Ok(())
26+
}
27+
```
28+
29+
# Support platform
30+
* Windows (MSVC and MinGW)
31+
* Linux
32+
33+
# TODO
34+
35+
* [ ] more doc
36+
* [ ] full bindings to `fido_cred_t` and `fido_assert_t`

0 commit comments

Comments
 (0)