yubico_otp

Yubikey validation Protocol 2.0 client implementation in Rust.

Example

```rust use yubico_otp::{client::Client, params::ApiCredentials, params::ValidationOption}; use std::process::ExitCode;

[tokio::main]

async fn main() -> Result> { let client = reqwest::Client::new(); let creds = ApiCredentials::frombase64secret( "yourclientid".into(), "yourbase64secretkey", )?; let client = Client::new(&client, creds); let opt = ValidationOption::default(); let (status, resp) = client .verify(std::env::args().nth(1).expect("OTP missing"), &opt) .await?; eprintln!("Status: {:?}", status); eprintln!("Response: {:?}", resp); Ok(if status.isok() { ExitCode::SUCCESS } else { ExitCode::FAILURE }) } ```