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') 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') 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') 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') 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') 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