diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-05-17 16:59:31 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-05-17 16:59:31 +0800 |
commit | 6d69eab6caff7b87d32fab3c7178296e481eb8a4 (patch) | |
tree | b421709339ac20068fba14dc64cc062031b9ed1f /docs/fernet.rst | |
parent | 60437c370d079d55db2c284e2f241ecde3b61cbf (diff) | |
download | cryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.tar.gz cryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.tar.bz2 cryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.zip |
Fixed TypeError and added documentation
Diffstat (limited to 'docs/fernet.rst')
-rw-r--r-- | docs/fernet.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/fernet.rst b/docs/fernet.rst index f55a2d60..b75be779 100644 --- a/docs/fernet.rst +++ b/docs/fernet.rst @@ -34,12 +34,15 @@ symmetric (also known as "secret key") authenticated cryptography. they'll also be able forge arbitrary messages that will be authenticated and decrypted. - .. method:: encrypt(plaintext) + .. method:: encrypt(data) - :param bytes plaintext: The message you would like to encrypt. + :param bytes data: The message you would like to encrypt. :returns bytes: A secure message that cannot be read or altered without the key. It is URL-safe base64-encoded. This is referred to as a "Fernet token". + :raises TypeError: This exception is raised if ``data`` is not a binary + type. This is ``str`` in Python 2 and ``bytes`` in + Python 3. .. note:: @@ -66,6 +69,9 @@ symmetric (also known as "secret key") authenticated cryptography. ``ttl``, it is malformed, or it does not have a valid signature. + :raises TypeError: This exception is raised if ``token`` is not a binary + type. This is ``str`` in Python 2 and ``bytes`` in + Python 3. .. class:: InvalidToken |