google-authenticator 0.1.1

This Rust crate can be used to interact with the Google Authenticator mobile app for 2-factor-authentication.
Documentation

yarclient

Introduction

This Rust crate can be used to interact with the Google Authenticator mobile app for 2-factor-authentication. This Rust crates can generate secrets, generate codes, validate codes and present a QR-Code for scanning the secret. It implements TOTP according to RFC6238

Build Status Build Status

Usage

Add this to your Cargo.toml:

[dependencies]
google-authenticator = "0.1.1"

Examples

 use google_authenticator::GoogleAuthenticator;
 let secret = "I3VFM3JKMNDJCDH5BMBEEQAW6KJ6NOE3";

 let auth = GoogleAuthenticator::new();
 let code = auth.get_code(secret,0).unwrap();

 if auth.verify_code(secret, code, 1, 0) {
      println!("match!");
 }

FAQ

You can post new issue for help.