[][src]Crate ctap

An implementation of the CTAP2 protocol over USB.

Example

let devices = ctap::get_devices()?;
let device_info = &devices[0];
let mut device = ctap::FidoDevice::new(device_info)?;

// This can be omitted if the FIDO device is not configured with a PIN.
let pin = "test";
device.unlock(pin)?;

// In a real application these values would come from the requesting app.
let rp_id = "rp_id";
let user_id = [0];
let user_name = "user_name";
let client_data_hash = [0; 32];
let cred = device.make_credential(
    rp_id,
    &user_id,
    user_name,
    &client_data_hash
)?;

// In a real application the credential would be stored and used later.
let result = device.get_assertion(&cred, &client_data_hash);

Structs

FidoCredential

A credential created by a FIDO2 authenticator.

FidoDevice

An opened FIDO authenticator.

FidoError

Enums

FidoErrorKind

Functions

get_devices

Looks for any connected HID devices and returns those that support FIDO.

Type Definitions

FidoResult