aboutsummaryrefslogtreecommitdiffstats
path: root/docs/fernet.rst
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-07-05 23:00:41 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2017-07-06 00:00:41 -0400
commit765a3e494e8196370995d2c698b6eda8492935e0 (patch)
tree1711b5bb8ccb8a690a5ce9a7debfda60418ff547 /docs/fernet.rst
parentf92f2d4d64efae073aaef2240f5f94df9955750b (diff)
downloadcryptography-765a3e494e8196370995d2c698b6eda8492935e0.tar.gz
cryptography-765a3e494e8196370995d2c698b6eda8492935e0.tar.bz2
cryptography-765a3e494e8196370995d2c698b6eda8492935e0.zip
write some words about encrypt/decrypt in fernet (#3756)
Diffstat (limited to 'docs/fernet.rst')
-rw-r--r--docs/fernet.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/fernet.rst b/docs/fernet.rst
index 65f70cf4..82d94faf 100644
--- a/docs/fernet.rst
+++ b/docs/fernet.rst
@@ -37,6 +37,9 @@ has support for implementing key rotation via :class:`MultiFernet`.
.. method:: encrypt(data)
+ Encrypts data passed. The result of this encryption is known as a
+ "Fernet token" and has strong privacy and authenticity guarantees.
+
: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
@@ -52,6 +55,11 @@ has support for implementing key rotation via :class:`MultiFernet`.
.. method:: decrypt(token, ttl=None)
+ Decrypts a Fernet token. If successfully decrypted you will receive the
+ original plaintext as the result, otherwise an exception will be
+ raised. It is safe to use this data immediately as Fernet verifies
+ that the data has not been tampered with prior to returning it.
+
:param bytes token: The Fernet token. This is the result of calling
:meth:`encrypt`.
:param int ttl: Optionally, the number of seconds old a message may be