GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  OATH_TOTP_GENERATE2 (3)

NAME

oath_totp_generate2 - API function

CONTENTS

Synopsis
Arguments
Copyright

SYNOPSIS

#include <oath.h>

int oath_totp_generate2(const char * secret, size_t secret_length, time_t now, unsigned time_step_size, time_t start_offset, unsigned digits, int flags, char * output_otp);

ARGUMENTS

const char * secret the shared secret string
size_t secret_length length of secret
time_t now Unix time value to compute TOTP for
unsigned time_step_size time step system parameter (typically 30)
time_t start_offset Unix time of when to start counting time steps (typically 0)
unsigned digits number of requested digits in the OTP, excluding checksum
int flags flags indicating mode, one of oath_totp_flags
char * output_otp output buffer, must have room for the output OTP plus zero

DESCRIPTION

Generate a one-time-password using the time-variant TOTP algorithm described in RFC 6238. The input parameters are taken as time values.

The system parameter time_step_size describes how long the time window for each OTP is. The recommended value is 30 seconds, and you can use the value 0 or the symbol OATH_TOTP_DEFAULT_TIME_STEP_SIZE to indicate this.

The system parameter start_offset denote the Unix time when time steps are started to be counted. The recommended value is 0, to fall back on the Unix epoch) and you can use the symbol OATH_TOTP_DEFAULT_START_TIME to indicate this.

The output_otp buffer must have room for at least digits characters, plus one for the terminating NUL.

Currently only values 6, 7 and 8 for digits are supported. This restriction may be lifted in future versions.

The flags parameter may be used to change the MAC function, for example OATH_TOTP_HMAC_SHA256 or OATH_TOTP_HMAC_SHA512.

RETURNS

On success, OATH_OK (zero) is returned, otherwise an error code is returned.

SINCE

2.6.0

REPORTING BUGS

Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page: http://www.gnu.org/software/liboath/ General help using GNU software: http://www.gnu.org/gethelp/

COPYRIGHT

Copyright © 2009-2015 Simon Josefsson.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
Search for    or go to Top of page |  Section 3 |  Main Index


liboath OATH_TOTP_GENERATE2 (3) 2.6.1

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.