aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/backends/multibackend.rst
blob: 63177bef16a410d66c6f7559b40b29f3e8774f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.. hazmat::

MultiBackend
============

.. currentmodule:: cryptography.hazmat.backends.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.

    .. 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.