aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/key-derivation-functions.rst
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-05-17 16:59:31 +0800
committerAyrx <terrycwk1994@gmail.com>2014-05-17 16:59:31 +0800
commit6d69eab6caff7b87d32fab3c7178296e481eb8a4 (patch)
treeb421709339ac20068fba14dc64cc062031b9ed1f /docs/hazmat/primitives/key-derivation-functions.rst
parent60437c370d079d55db2c284e2f241ecde3b61cbf (diff)
downloadcryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.tar.gz
cryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.tar.bz2
cryptography-6d69eab6caff7b87d32fab3c7178296e481eb8a4.zip
Fixed TypeError and added documentation
Diffstat (limited to 'docs/hazmat/primitives/key-derivation-functions.rst')
-rw-r--r--docs/hazmat/primitives/key-derivation-functions.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/key-derivation-functions.rst b/docs/hazmat/primitives/key-derivation-functions.rst
index de6bf5f8..c9c0c3cc 100644
--- a/docs/hazmat/primitives/key-derivation-functions.rst
+++ b/docs/hazmat/primitives/key-derivation-functions.rst
@@ -88,6 +88,10 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend`
+ :raises TypeError: This exception is raised if ``salt`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
+
.. method:: derive(key_material)
:param bytes key_material: The input key material. For PBKDF2 this
@@ -99,6 +103,10 @@ Different KDFs are suitable for different tasks such as:
called more than
once.
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
+
This generates and returns a new key from the supplied password.
.. method:: verify(key_material, expected_key)
@@ -191,10 +199,17 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
+ :raises TypeError: This exception is raised if ``salt`` or ``info`` is not
+ a binary type. This is ``str`` in Python 2 and ``bytes``
+ in Python 3.
+
.. method:: derive(key_material)
:param bytes key_material: The input key material.
:return bytes: The derived key.
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
Derives a new key from the input key material by performing both the
extract and expand operations.
@@ -277,6 +292,9 @@ Different KDFs are suitable for different tasks such as:
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
:raises TypeError: This is raised if the provided ``info`` is a unicode object
+ :raises TypeError: This exception is raised if ``info`` is not a binary
+ type. This is ``str`` in Python 2 and ``bytes`` in
+ Python 3.
.. method:: derive(key_material)
@@ -285,6 +303,9 @@ Different KDFs are suitable for different tasks such as:
:raises TypeError: This is raised if the provided ``key_material`` is
a unicode object
+ :raises TypeError: This exception is raised if ``key_material`` is not
+ a binary type. This is ``str`` in Python 2 and
+ ``bytes`` in Python 3.
Derives a new key from the input key material by performing both the
extract and expand operations.