File Information
Library: OSP/Auth/TwoFactor
Package: TwoFactor
Header: Poco/OSP/Auth/TwoFactor/HOTPGenerator.h
Description
This class generates HOTPs (HMAC-based One Time Passwords) according to RFC 4226.
The hash function for the HMAC is configurable via a template parameter and is typically Poco::SHA1Engine.
Member Summary
Member Functions: digitsPower, generate
Constructors
HOTPGenerator
explicit HOTPGenerator(
const std::string & secret,
std::size_t codeDigits = 6
);
Creates the HOTPGenerator with the given secret (binary string) and number of code digits, which should be from 6-8.
Member Functions
generate
std::string generate(
Poco::UInt64 movingFactor
);
Returns a HOTP string based on the secret and the given movingFactor.
digitsPower
Poco::UInt32 digitsPower() const;