From 031c2cb544478b4dee341bcf76fb359ad8ac788a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 31 Jan 2014 11:44:53 -0800 Subject: Fixes #539 -- document which interfaces a backend implements --- docs/hazmat/backends/commoncrypto.rst | 9 ++++++++- docs/hazmat/backends/openssl.rst | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/commoncrypto.rst b/docs/hazmat/backends/commoncrypto.rst index af2032b6..7bf1bc42 100644 --- a/docs/hazmat/backends/commoncrypto.rst +++ b/docs/hazmat/backends/commoncrypto.rst @@ -11,7 +11,14 @@ The `CommonCrypto`_ C library provided by Apple on OS X and iOS. .. data:: cryptography.hazmat.backends.commoncrypto.backend - This is the exposed API for the CommonCrypto backend. It has one public attribute. + This is the exposed API for the CommonCrypto backend. + + * :class:`~cryptography.hazmat.backends.interfaces.CipherBackend` + * :class:`~cryptography.hazmat.backends.interfaces.HashBackend` + * :class:`~cryptography.hazmat.backends.interfaces.HMACBackend` + * :class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend` + + It has one additional public attribute. .. attribute:: name diff --git a/docs/hazmat/backends/openssl.rst b/docs/hazmat/backends/openssl.rst index 12d2d9f6..4db3972d 100644 --- a/docs/hazmat/backends/openssl.rst +++ b/docs/hazmat/backends/openssl.rst @@ -7,7 +7,16 @@ The `OpenSSL`_ C library. .. data:: cryptography.hazmat.backends.openssl.backend - This is the exposed API for the OpenSSL backend. It has one public attribute. + This is the exposed API for the OpenSSL backend. + + It implements the following interfaces: + + * :class:`~cryptography.hazmat.backends.interfaces.CipherBackend` + * :class:`~cryptography.hazmat.backends.interfaces.HashBackend` + * :class:`~cryptography.hazmat.backends.interfaces.HMACBackend` + * :class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend` + + It has one additional public attribute. .. attribute:: name -- cgit v1.2.3 From 8ca6fadca6b4c8805c241382e24d87c127cff306 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 31 Jan 2014 13:23:51 -0800 Subject: Complete sentences. --- docs/hazmat/backends/commoncrypto.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/commoncrypto.rst b/docs/hazmat/backends/commoncrypto.rst index 7bf1bc42..16a61337 100644 --- a/docs/hazmat/backends/commoncrypto.rst +++ b/docs/hazmat/backends/commoncrypto.rst @@ -13,6 +13,8 @@ The `CommonCrypto`_ C library provided by Apple on OS X and iOS. This is the exposed API for the CommonCrypto backend. + It implements the following interfaces: + * :class:`~cryptography.hazmat.backends.interfaces.CipherBackend` * :class:`~cryptography.hazmat.backends.interfaces.HashBackend` * :class:`~cryptography.hazmat.backends.interfaces.HMACBackend` -- cgit v1.2.3 From 450bb4c6609d246ded86959de3d925df81afdba9 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Feb 2014 15:42:04 -0800 Subject: Rename and document --- docs/hazmat/backends/multibackend.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/hazmat/backends/multibackend.rst (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/multibackend.rst b/docs/hazmat/backends/multibackend.rst new file mode 100644 index 00000000..23e6d48f --- /dev/null +++ b/docs/hazmat/backends/multibackend.rst @@ -0,0 +1,14 @@ +.. hazmat:: + +MultiBackend +============ + +.. currentmodule:: cryptography.hazmat.backends.multibackend + +.. class:: MultiBackend(backends) + + This class allows you to combine multiple backends into a single backend + which offers the combined features of all of its constituents. + + :param backends: A ``list`` of backend objects. Backends are checked for + feature support in the other they exist in this list. -- cgit v1.2.3 From 7ceacba2f3c24e7333bf9af901541055bb3a51ab Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Feb 2014 15:50:03 -0800 Subject: Added to toctree --- docs/hazmat/backends/index.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/index.rst b/docs/hazmat/backends/index.rst index dbc0724e..983a44e9 100644 --- a/docs/hazmat/backends/index.rst +++ b/docs/hazmat/backends/index.rst @@ -32,4 +32,5 @@ Individual Backends openssl commoncrypto + multibackend interfaces -- cgit v1.2.3 From 2b1752ed68a08255ddacf1800c6cb6b406ce5e4b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Feb 2014 16:11:23 -0800 Subject: Typo fix --- docs/hazmat/backends/multibackend.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/multibackend.rst b/docs/hazmat/backends/multibackend.rst index 23e6d48f..971c7671 100644 --- a/docs/hazmat/backends/multibackend.rst +++ b/docs/hazmat/backends/multibackend.rst @@ -11,4 +11,4 @@ MultiBackend which offers the combined features of all of its constituents. :param backends: A ``list`` of backend objects. Backends are checked for - feature support in the other they exist in this list. + feature support in the order they appear in this list. -- cgit v1.2.3 From 559885087728c0233b243756fe698e4071fab971 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Feb 2014 16:15:06 -0800 Subject: Added an example usage --- docs/hazmat/backends/multibackend.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/multibackend.rst b/docs/hazmat/backends/multibackend.rst index 971c7671..f1a88006 100644 --- a/docs/hazmat/backends/multibackend.rst +++ b/docs/hazmat/backends/multibackend.rst @@ -10,5 +10,17 @@ MultiBackend This class allows you to combine multiple backends into a single backend which offers the combined features of all of its constituents. + .. code-block:: pycon + + >>> from cryptography.hazmat.backends.multibackend import MultiBackend + >>> from cryptography.hazmat.primitives import hashes + >>> backend1.hash_supported(hashes.SHA256()) + False + >>> backend2.hash_supported(hashes.SHA1()) + True + >>> multi_backend = MultiBackend([backend1, backend2]) + >>> multi_backend.hash_supported(hashes.SHA1()) + True + :param backends: A ``list`` of backend objects. Backends are checked for feature support in the order they appear in this list. -- cgit v1.2.3 From db80954cf1448f88fae78568dbd3d833da04054a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Feb 2014 16:19:32 -0800 Subject: Chanloge + versionadded --- docs/hazmat/backends/multibackend.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/multibackend.rst b/docs/hazmat/backends/multibackend.rst index f1a88006..63177bef 100644 --- a/docs/hazmat/backends/multibackend.rst +++ b/docs/hazmat/backends/multibackend.rst @@ -7,6 +7,8 @@ MultiBackend .. class:: MultiBackend(backends) + .. versionadded:: 0.2 + This class allows you to combine multiple backends into a single backend which offers the combined features of all of its constituents. -- cgit v1.2.3