Skip to content

Commit 00f732d

Browse files
committed
add readme.md to fido2-rs
1 parent adeccf9 commit 00f732d

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

README.MD

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
1. Make a credential
88
```rust
99
use fido2_rs::device::Device;
10-
use fido2_rs::credentials::CredentialRequest;
10+
use fido2_rs::credentials::Credential;
1111
use fido2_rs::credentials::CoseType;
1212
use anyhow::Result;
13-
1413
fn main() -> Result<()> {
1514
let dev = Device::open("windows://hello").expect("unable open windows hello");
1615

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)?;
16+
let mut cred = Credential::new();
17+
cred.set_client_data(&[1, 2, 3, 4, 5, 6])?;
18+
cred.set_rp("fido_rs", "fido example")?;
19+
cred.set_user(&[1, 2, 3, 4, 5, 6], "alice", Some("alice"), None)?;
20+
cred.set_cose_type(CoseType::RS256)?;
21+
22+
let _ = dev.make_credential(&mut cred, None)?;
2423
dbg!(cred.id());
24+
2525
Ok(())
2626
}
2727
```
@@ -33,4 +33,4 @@ fn main() -> Result<()> {
3333
# TODO
3434

3535
* [ ] more doc
36-
* [ ] full bindings to `fido_cred_t` and `fido_assert_t`
36+
* [x] full bindings to `fido_cred_t` and `fido_assert_t`

fido2-rs/README.MD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# fido2-rs
2+
3+
[libfido2](https://github.com/Yubico/libfido2) bindings for the Rust programming language.
4+
5+
For more details, see [tyan-boot/fido-rs](https://github.com/tyan-boot/fido-rs)

0 commit comments

Comments
 (0)