aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/twofactor.rst
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-02-23 00:23:55 +0800
committerAyrx <terrycwk1994@gmail.com>2014-02-25 10:36:32 +0800
commit52e1e930880456e69b9a0fdd371337225fc3511b (patch)
treefe98011b85c28520aeb26775940cb654b097faef /docs/hazmat/primitives/twofactor.rst
parentcec584caa9b857da35b8e8a8f0b1f7295ddf661f (diff)
downloadcryptography-52e1e930880456e69b9a0fdd371337225fc3511b.tar.gz
cryptography-52e1e930880456e69b9a0fdd371337225fc3511b.tar.bz2
cryptography-52e1e930880456e69b9a0fdd371337225fc3511b.zip
Added method definitions to TOTP documentation.
Diffstat (limited to 'docs/hazmat/primitives/twofactor.rst')
-rw-r--r--docs/hazmat/primitives/twofactor.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/hazmat/primitives/twofactor.rst b/docs/hazmat/primitives/twofactor.rst
index 3951a1cc..2e170b85 100644
--- a/docs/hazmat/primitives/twofactor.rst
+++ b/docs/hazmat/primitives/twofactor.rst
@@ -59,7 +59,7 @@ codes (HMAC).
.. method:: verify(hotp, counter)
:param bytes hotp: The one time password value to validate.
- :param bytes counter: The counter value to validate against.
+ :param int counter: The counter value to validate against.
:raises cryptography.exceptions.InvalidToken: This is raised when the supplied HOTP
does not match the expected HOTP.
@@ -139,3 +139,15 @@ This can be accomplished with something similar to the following code.
or if the ``length`` parameter is not 6, 7 or 8.
:raises UnsupportedAlgorithm: This is raised if the provided ``algorithm`` is not
``SHA1()``, ``SHA256()`` or ``SHA512()``.
+
+ .. method:: generate(time)
+
+ :param int counter: The time value used to generate the one time password.
+ :return bytes: A one time password value.
+
+ .. method:: verify(totp, time)
+
+ :param bytes hotp: The one time password value to validate.
+ :param int time: The time value to validate against.
+ :raises cryptography.exceptions.InvalidToken: This is raised when the supplied TOTP
+ does not match the expected TOTP.