blob: f1a8800661426c899e4de85ab02020c82e17cfd8 [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
10 This class allows you to combine multiple backends into a single backend
11 which offers the combined features of all of its constituents.
12
Alex Gaynor55988502014-02-03 16:15:06 -080013 .. code-block:: pycon
14
15 >>> from cryptography.hazmat.backends.multibackend import MultiBackend
16 >>> from cryptography.hazmat.primitives import hashes
17 >>> backend1.hash_supported(hashes.SHA256())
18 False
19 >>> backend2.hash_supported(hashes.SHA1())
20 True
21 >>> multi_backend = MultiBackend([backend1, backend2])
22 >>> multi_backend.hash_supported(hashes.SHA1())
23 True
24
Alex Gaynor450bb4c2014-02-03 15:42:04 -080025 :param backends: A ``list`` of backend objects. Backends are checked for
Alex Gaynor2b1752e2014-02-03 16:11:23 -080026 feature support in the order they appear in this list.