blob: 63177bef16a410d66c6f7559b40b29f3e8774f6f [file] [log] [blame]
Alex Gaynor450bb4c2014-02-03 15:42:04 -08001.. hazmat::
2
3MultiBackend
4============
5
6.. currentmodule:: cryptography.hazmat.backends.multibackend
7
8.. class:: MultiBackend(backends)
9
Alex Gaynordb809542014-02-03 16:19:32 -080010 .. versionadded:: 0.2
11
Alex Gaynor450bb4c2014-02-03 15:42:04 -080012 This class allows you to combine multiple backends into a single backend
13 which offers the combined features of all of its constituents.
14
Alex Gaynor55988502014-02-03 16:15:06 -080015 .. code-block:: pycon
16
17 >>> from cryptography.hazmat.backends.multibackend import MultiBackend
18 >>> from cryptography.hazmat.primitives import hashes
19 >>> backend1.hash_supported(hashes.SHA256())
20 False
21 >>> backend2.hash_supported(hashes.SHA1())
22 True
23 >>> multi_backend = MultiBackend([backend1, backend2])
24 >>> multi_backend.hash_supported(hashes.SHA1())
25 True
26
Alex Gaynor450bb4c2014-02-03 15:42:04 -080027 :param backends: A ``list`` of backend objects. Backends are checked for
Alex Gaynor2b1752e2014-02-03 16:11:23 -080028 feature support in the order they appear in this list.