aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/interfaces.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/hazmat/primitives/interfaces.rst')
-rw-r--r--docs/hazmat/primitives/interfaces.rst67
1 files changed, 67 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst
index ce8b7c70..95fd6f9f 100644
--- a/docs/hazmat/primitives/interfaces.rst
+++ b/docs/hazmat/primitives/interfaces.rst
@@ -112,6 +112,27 @@ Asymmetric interfaces
An `RSA`_ private key.
+ .. method:: signer(padding, algorithm, backend)
+
+ .. versionadded:: 0.3
+
+ Sign data which can be verified later by others using the public key.
+
+ :param padding: An instance of a
+ :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding`
+ provider.
+
+ :param algorithm: An instance of a
+ :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm`
+ provider.
+
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+ provider.
+
+ :returns:
+ :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricSignatureContext`
+
.. method:: public_key()
:return: :class:`~cryptography.hazmat.primitives.interfaces.RSAPublicKey`
@@ -200,6 +221,31 @@ Asymmetric interfaces
An `RSA`_ public key.
+ .. method:: verifier(signature, padding, algorithm, backend)
+
+ .. versionadded:: 0.3
+
+ Verify data was signed by the private key associated with this public
+ key.
+
+ :param bytes signature: The signature to verify.
+
+ :param padding: An instance of a
+ :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding`
+ provider.
+
+ :param algorithm: An instance of a
+ :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm`
+ provider.
+
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+ provider.
+
+ :returns:
+ :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext`
+
+
.. attribute:: modulus
:type: int
@@ -402,6 +448,27 @@ Hash algorithms
The internal block size of the hash algorithm in bytes.
+.. class:: HashContext
+
+ .. attribute:: algorithm
+
+ A :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` that
+ will be used by this context.
+
+ .. method:: update(data)
+
+ :param data bytes: The data you want to hash.
+
+ .. method:: finalize()
+
+ :return: The final digest as bytes.
+
+ .. method:: copy()
+
+ :return: A :class:`~cryptography.hazmat.primitives.interfaces.HashContext`
+ that is a copy of the current context.
+
+
Key derivation functions
~~~~~~~~~~~~~~~~~~~~~~~~