Alex Gaynor | 450bb4c | 2014-02-03 15:42:04 -0800 | [diff] [blame] | 1 | .. hazmat:: |
| 2 | |
| 3 | MultiBackend |
| 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 Gaynor | 5598850 | 2014-02-03 16:15:06 -0800 | [diff] [blame^] | 13 | .. 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 Gaynor | 450bb4c | 2014-02-03 15:42:04 -0800 | [diff] [blame] | 25 | :param backends: A ``list`` of backend objects. Backends are checked for |
Alex Gaynor | 2b1752e | 2014-02-03 16:11:23 -0800 | [diff] [blame] | 26 | feature support in the order they appear in this list. |