.\" DO NOT MODIFY THIS FILE! It was generated by gdoc. .TH "oath_hotp_generate" 3 "2.6.11" "liboath" "liboath" .SH NAME oath_hotp_generate \- API function .SH SYNOPSIS .B #include .sp .BI "int oath_hotp_generate(const char * " secret ", size_t " secret_length ", uint64_t " moving_factor ", unsigned " digits ", bool " add_checksum ", size_t " truncation_offset ", char * " output_otp ");" .SH ARGUMENTS .IP "const char * secret" 12 the shared secret string .IP "size_t secret_length" 12 length of \fIsecret\fP .IP "uint64_t moving_factor" 12 a counter indicating the current OTP to generate .IP "unsigned digits" 12 number of requested digits in the OTP, excluding checksum .IP "bool add_checksum" 12 whether to add a checksum digit or not .IP "size_t truncation_offset" 12 use a specific truncation offset .IP "char * output_otp" 12 output buffer, must have room for the output OTP plus zero .SH "DESCRIPTION" Generate a one\-time\-password using the HOTP algorithm as described in RFC 4226. Use a value of \fBOATH_HOTP_DYNAMIC_TRUNCATION\fP for \fItruncation_offset\fP unless you really need a specific truncation offset. To find out the size of the OTP you may use the \fBOATH_HOTP_LENGTH()\fP macro. The \fIoutput_otp\fP buffer must be have room for that length plus one for the terminating NUL. Currently only values 6, 7 and 8 for \fIdigits\fP are supported, and the \fIadd_checksum\fP value is ignored. These restrictions may be lifted in future versions, although some limitations are inherent in the protocol. .SH "RETURNS" On success, \fBOATH_OK\fP (zero) is returned, otherwise an error code is returned. .SH "REPORTING BUGS" Report bugs to . liboath home page: https://www.nongnu.org/oath-toolkit/ General help using GNU software: http://www.gnu.org/gethelp/ .SH COPYRIGHT Copyright \(co 2009-2020 Simon Josefsson. .br 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.