Crate oath [] [src]

rust-oath is a rust implementation of three one-time password generators: HOTP, TOTP, OCRA

Enums

HashType

HashType enum represents possible hashing modes.

Functions

from_hex

This library provides a wrapper around rustc_hex::from_hex(). This helps with the functions that expect byte arrays.

hotp

Hi-level function, that computes an one-time password using HOTP algorithm. Same as hotp_raw, but expects key to be a &str instead.

hotp_raw

Computes an one-time password using HOTP algorithm. Same as hotp, but expects key to be a &[u8].

ocra

ocra is a wrapper over ocra_debug function. Use this function in production code! ocra function doesn't leak any info about internal errors, because such internal info could be a starting point for hackers.

ocra_debug

ocra_debug is an OCRA implementation with detailed errors descriptions. Use it for debugging purpose only! For production code use ocra function.

totp_custom

Low-level function, that computes an one-time password using TOTP algorithm. It's generic over hashing algorithm D.

totp_custom_time

Computes an one-time password using TOTP algorithm for arbitrary timestamp. Same as totp_raw_custom_time, but expects key to be a &str and returns Result.

totp_now

Computes an one-time password for current moment of time using TOTP algorithm. Same as totp_raw_now, but expects key to be a &str and returns Result.

totp_raw_custom_time

Computes an one-time password using TOTP algorithm for arbitrary timestamp. Same as totp_custom_time, but expects key to be a &[u8].

totp_raw_now

Computes an one-time password for this moment using TOTP algorithm. Same as totp_now, but expects key to be a &[u8].