aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/asymmetric/interfaces.rst
blob: a5dbc671c03097e66e3d5b08137f1754fc0b6645 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.. hazmat::

.. module:: cryptography.hazmat.primitives.asymmetric

Signature Interfaces
====================

.. class:: AsymmetricSignatureContext

    .. versionadded:: 0.2

    .. note::

        :class:`~cryptography.hazmat.primitives.asymmetric.utils.Prehashed`
        is not supported by this context. You must use the ``sign`` method
        on the private key object.

    .. method:: update(data)

        :param bytes data: The data you want to sign.

    .. method:: finalize()

        :return bytes signature: The signature.


.. class:: AsymmetricVerificationContext

    .. versionadded:: 0.2

    .. note::

        :class:`~cryptography.hazmat.primitives.asymmetric.utils.Prehashed`
        is not supported by this context. You must use the ``verify`` method
        on the public key object.

    .. method:: update(data)

        :param bytes data: The data you wish to verify using the signature.

    .. method:: verify()

        :raises cryptography.exceptions.InvalidSignature: If the signature does
            not validate.