libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::Totp Class Referencefinal

TOTP code generation (RFC 6238). More...

#include <totp.hh>

Static Public Member Functions

static std::string Generate (const TotpConfig &config, std::time_t time=0)
 Generates the current TOTP code.
 
static std::string Generate (const Entry &entry, std::time_t time=0)
 Generates a code for the TOTP fields of an entry.
 
static uint32_t SecondsRemaining (const TotpConfig &config, std::time_t time=0)
 Returns the number of seconds until the current time step expires.
 

Detailed Description

TOTP code generation (RFC 6238).

Member Function Documentation

◆ Generate() [1/2]

static std::string keepass::Totp::Generate ( const Entry &  entry,
std::time_t  time = 0 
)
static

Generates a code for the TOTP fields of an entry.

Parameters
entryEntry whose custom fields are inspected.
timeUnix time to use; 0 means the current system time.
Returns
The code, or an empty string if the entry has no valid TOTP field.

◆ Generate() [2/2]

static std::string keepass::Totp::Generate ( const TotpConfig &  config,
std::time_t  time = 0 
)
static

Generates the current TOTP code.

Parameters
configParsed parameters.
timeUnix time to use; 0 means the current system time.
Returns
The zero-padded code, or an empty string if the secret is invalid.

◆ SecondsRemaining()

static uint32_t keepass::Totp::SecondsRemaining ( const TotpConfig &  config,
std::time_t  time = 0 
)
static

Returns the number of seconds until the current time step expires.

Parameters
configParsed parameters.
timeUnix time to use; 0 means the current system time.
Returns
Seconds until the next code, or 0 if the parameters are invalid.

The documentation for this class was generated from the following file: