Crate steam_totp

Source
Expand description

Direct port of DoctorMcKay/node-steam-totp

This crate generates Steam 2FA auth codes for a shared secret. It currently requires nightly Rust.

§Example

use steam_totp::{Time,Secret,generate_auth_code};

let time = Time::with_offset().await?;
let shared_secret = Secret::from_hex("deadbeefcafe")?;
let auth_code = generate_auth_code(shared_secret, time);

println!("{}", auth_code);  // Will print a 5 character code similar to "R7VRC"

Re-exports§

pub use time::Time;

Modules§

error
Module containing error types used by this crate.
steam_api
Module containing deserializable structs for Steam API responses.
time

Structs§

Secret
Struct for working with your TOTP shared secret.

Functions§

generate_auth_code
Generate a Steam TOTP authentication code.
generate_auth_code_async
Generate a Steam TOTP authentication code asynchronously.
generate_auth_code_with_time_async
Same as generate_auth_code_async, but returns also the time found on Steam servers.
generate_confirmation_key
Returns a string containing your confirmation key for use with the mobile confirmations web page.
get_device_id
Get a standardized device ID based on your SteamID.

Type Aliases§

Result
The steam_totp Result type.