aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Orisaka <orisaka@gmail.com>2016-07-18 21:54:23 -0300
committerAlex Gaynor <alex.gaynor@gmail.com>2016-07-18 20:54:23 -0400
commit6868b1f01904270b286a4bf9dbb355e792df8f36 (patch)
treeb854f6b63a30c3ef1f3c8aa5a618e5bbd148bc88
parent05aac201fc12d619facd6247f348c2015b688bc1 (diff)
downloadcryptography-6868b1f01904270b286a4bf9dbb355e792df8f36.tar.gz
cryptography-6868b1f01904270b286a4bf9dbb355e792df8f36.tar.bz2
cryptography-6868b1f01904270b286a4bf9dbb355e792df8f36.zip
Removed provider language from backend interfaces (#3047)
-rw-r--r--docs/hazmat/backends/interfaces.rst191
1 files changed, 81 insertions, 110 deletions
diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst
index 218bc0cb..14f72cf6 100644
--- a/docs/hazmat/backends/interfaces.rst
+++ b/docs/hazmat/backends/interfaces.rst
@@ -29,11 +29,11 @@ A specific ``backend`` may provide one or more of these interfaces.
Check if a ``cipher`` and ``mode`` combination is supported by
this backend.
- :param cipher: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`
- provider.
- :param mode: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode` provider.
+ :param cipher: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`.
+
+ :param mode: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode`.
:returns: ``True`` if the specified ``cipher`` and ``mode`` combination
is supported by this backend, otherwise ``False``
@@ -46,11 +46,11 @@ A specific ``backend`` may provide one or more of these interfaces.
can be used for encrypting data with the symmetric ``cipher`` using
the given ``mode``.
- :param cipher: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`
- provider.
- :param mode: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode` provider.
+ :param cipher: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`.
+
+ :param mode: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode`.
:returns:
:class:`~cryptography.hazmat.primitives.ciphers.CipherContext`
@@ -65,11 +65,11 @@ A specific ``backend`` may provide one or more of these interfaces.
can be used for decrypting data with the symmetric ``cipher`` using
the given ``mode``.
- :param cipher: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`
- provider.
- :param mode: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode` provider.
+ :param cipher: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.CipherAlgorithm`.
+
+ :param mode: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.modes.Mode`.
:returns:
:class:`~cryptography.hazmat.primitives.ciphers.CipherContext`
@@ -90,9 +90,8 @@ A specific ``backend`` may provide one or more of these interfaces.
Check if the specified ``algorithm`` is supported by this backend.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns: ``True`` if the specified ``algorithm`` is supported by this
backend, otherwise ``False``.
@@ -104,9 +103,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:class:`~cryptography.hazmat.primitives.hashes.HashContext` that
uses the specified ``algorithm`` to calculate a message digest.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns:
:class:`~cryptography.hazmat.primitives.hashes.HashContext`
@@ -126,9 +124,8 @@ A specific ``backend`` may provide one or more of these interfaces.
Check if the specified ``algorithm`` is supported by this backend.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns: ``True`` if the specified ``algorithm`` is supported for HMAC
by this backend, otherwise ``False``.
@@ -142,9 +139,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:param bytes key: Secret key as ``bytes``.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns:
:class:`~cryptography.hazmat.primitives.hashes.HashContext`
@@ -158,9 +154,9 @@ A specific ``backend`` may provide one or more of these interfaces.
.. method:: cmac_algorithm_supported(algorithm)
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.BlockCipherAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.BlockCipherAlgorithm`.
+
:return: Returns True if the block cipher is supported for CMAC by this backend
.. method:: create_cmac_ctx(algorithm)
@@ -169,9 +165,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:class:`~cryptography.hazmat.primitives.interfaces.MACContext` that
uses the specified ``algorithm`` to calculate a message authentication code.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.ciphers.BlockCipherAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.ciphers.BlockCipherAlgorithm`.
:returns:
:class:`~cryptography.hazmat.primitives.interfaces.MACContext`
@@ -192,18 +187,16 @@ A specific ``backend`` may provide one or more of these interfaces.
Check if the specified ``algorithm`` is supported by this backend.
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns: ``True`` if the specified ``algorithm`` is supported for
PBKDF2 HMAC by this backend, otherwise ``False``.
.. method:: derive_pbkdf2_hmac(self, algorithm, length, salt, iterations, key_material)
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:param int length: The desired length of the derived key. Maximum is
(2\ :sup:`32` - 1) * ``algorithm.digest_size``
@@ -235,9 +228,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:param int key_size: The length in bits of the modulus. Should be
at least 2048.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey`.
:raises ValueError: If the public_exponent is not valid.
@@ -245,9 +237,8 @@ A specific ``backend`` may provide one or more of these interfaces.
Check if the specified ``padding`` is supported by the backend.
- :param padding: An instance of an
- :class:`~cryptography.hazmat.primitives.asymmetric.padding.AsymmetricPadding`
- provider.
+ :param padding: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.padding.AsymmetricPadding`.
:returns: ``True`` if the specified ``padding`` is supported by this
backend, otherwise ``False``.
@@ -266,7 +257,7 @@ A specific ``backend`` may provide one or more of these interfaces.
:param numbers: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`.
- :returns: A provider of
+ :returns: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey`.
:raises ValueError: This is raised when the values of ``p``, ``q``,
@@ -281,7 +272,7 @@ A specific ``backend`` may provide one or more of these interfaces.
:param numbers: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers`.
- :returns: A provider of
+ :returns: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey`.
:raises ValueError: This is raised when the values of
@@ -307,19 +298,16 @@ A specific ``backend`` may provide one or more of these interfaces.
support for larger key sizes specified in FIPS 186-3 and are still
restricted to only the 1024-bit keys specified in FIPS 186-2.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameters`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameters`.
.. method:: generate_dsa_private_key(parameters)
- :param parameters: A
- :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameters`
- provider.
+ :param parameters: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameters`.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKey`.
:raises ValueError: This is raised if the key size is not one of 1024,
2048, or 3072.
@@ -333,18 +321,16 @@ A specific ``backend`` may provide one or more of these interfaces.
support for larger key sizes specified in FIPS 186-3 and are still
restricted to only the 1024-bit keys specified in FIPS 186-2.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKey`.
:raises ValueError: This is raised if the key size is not supported
by the backend.
.. method:: dsa_hash_supported(algorithm)
- :param algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`
- provider.
+ :param algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`.
:returns: ``True`` if the specified ``algorithm`` is supported by this
backend, otherwise ``False``.
@@ -365,7 +351,7 @@ A specific ``backend`` may provide one or more of these interfaces.
:param numbers: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameterNumbers`.
- :returns: A provider of
+ :returns: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameters`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
@@ -376,7 +362,7 @@ A specific ``backend`` may provide one or more of these interfaces.
:param numbers: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateNumbers`.
- :returns: A provider of
+ :returns: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateKey`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
@@ -387,7 +373,7 @@ A specific ``backend`` may provide one or more of these interfaces.
:param numbers: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers`.
- :returns: A provider of
+ :returns: An instance of
:class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKey`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
@@ -400,49 +386,41 @@ A specific ``backend`` may provide one or more of these interfaces.
.. method:: elliptic_curve_supported(curve)
- :param curve: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`
- provider.
+ :param curve: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`.
:returns: True if the elliptic curve is supported by this backend.
.. method:: elliptic_curve_signature_algorithm_supported(signature_algorithm, curve)
- :param signature_algorithm: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurveSignatureAlgorithm`
- provider.
+ :param signature_algorithm: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurveSignatureAlgorithm`.
- :param curve: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`
- provider.
+ :param curve: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`.
:returns: True if the signature algorithm and curve are supported by this backend.
.. method:: generate_elliptic_curve_private_key(curve)
- :param curve: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`
- provider.
+ :param curve: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`.
.. method:: load_elliptic_curve_private_numbers(numbers)
- :param numbers: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateNumbers`
- provider.
+ :param numbers: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateNumbers`.
- :returns: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey`
- provider.
+ :returns: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey`.
.. method:: load_elliptic_curve_public_numbers(numbers)
- :param numbers: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers`
- provider.
+ :param numbers: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers`.
- :returns: An instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey`
- provider.
+ :returns: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey`.
.. class:: PEMSerializationBackend
@@ -608,29 +586,25 @@ A specific ``backend`` may provide one or more of these interfaces.
:param int key_size: The bit length of the prime modulus to generate.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`.
:raises ValueError: If ``key_size`` is not at least 512.
.. method:: generate_dh_private_key(parameters)
- :param parameters: A
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`
- provider.
+ :param parameters: An instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`.
.. method:: generate_dh_private_key_and_parameters(self, key_size)
:param int key_size: The bit length of the prime modulus to generate.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`.
:raises ValueError: If ``key_size`` is not at least 512.
@@ -640,9 +614,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateNumbers`
instance.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
when any backend specific criteria are not met.
@@ -653,9 +626,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPublicNumbers`
instance.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPublicKey`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHPublicKey`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
when any backend specific criteria are not met.
@@ -666,9 +638,8 @@ A specific ``backend`` may provide one or more of these interfaces.
:class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameterNumbers`
instance.
- :return: A new instance of a
- :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`
- provider.
+ :return: A new instance of
+ :class:`~cryptography.hazmat.primitives.asymmetric.dh.DHParameters`.
:raises cryptography.exceptions.UnsupportedAlgorithm: This is raised
when any backend specific criteria are not met.