diff options
Diffstat (limited to 'docs/hazmat/primitives/interfaces.rst')
-rw-r--r-- | docs/hazmat/primitives/interfaces.rst | 176 |
1 files changed, 87 insertions, 89 deletions
diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index 029c4c1f..755cef41 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -13,7 +13,7 @@ to document argument and return types. Symmetric ciphers -~~~~~~~~~~~~~~~~~ +----------------- .. currentmodule:: cryptography.hazmat.primitives.interfaces @@ -48,7 +48,7 @@ Symmetric ciphers Cipher modes ------------- +~~~~~~~~~~~~ Interfaces used by the symmetric cipher modes described in :ref:`Symmetric Encryption Modes <symmetric-encryption-modes>`. @@ -104,7 +104,44 @@ Interfaces used by the symmetric cipher modes described in individual modes. Asymmetric interfaces -~~~~~~~~~~~~~~~~~~~~~ +--------------------- + +.. class:: AsymmetricSignatureContext + + .. versionadded:: 0.2 + + .. method:: update(data) + + :param bytes data: The data you want to sign. + + .. method:: finalize() + + :return bytes signature: The signature. + + +.. class:: AsymmetricVerificationContext + + .. versionadded:: 0.2 + + .. 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. + + +.. class:: AsymmetricPadding + + .. versionadded:: 0.2 + + .. attribute:: name + + +RSA +~~~ .. class:: RSAPrivateKey @@ -236,55 +273,31 @@ Asymmetric interfaces instance. +DSA +~~~ + .. class:: DSAParameters .. versionadded:: 0.3 `DSA`_ parameters. - .. attribute:: modulus - :type: int +.. class:: DSAParametersWithNumbers - The prime modulus that is used in generating the DSA key pair and used - in the DSA signing and verification processes. - - .. attribute:: subgroup_order - - :type: int - - The subgroup order that is used in generating the DSA key pair - by the generator and used in the DSA signing and verification - processes. - - .. attribute:: generator - - :type: int - - The generator that is used in generating the DSA key pair and used - in the DSA signing and verification processes. - - .. attribute:: p - - :type: int - - The prime modulus that is used in generating the DSA key pair and used - in the DSA signing and verification processes. Alias for :attr:`modulus`. - - .. attribute:: q - - :type: int + .. versionadded:: 0.5 - The subgroup order that is used in generating the DSA key pair - by the generator and used in the DSA signing and verification - processes. Alias for :attr:`subgroup_order`. + Extends :class:`DSAParameters`. - .. attribute:: g + .. method:: parameter_numbers() - :type: int + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameterNumbers` + object. - The generator that is used in generating the DSA key pair and used - in the DSA signing and verification processes. Alias for :attr:`generator`. + :returns: A + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAParameterNumbers` + instance. .. class:: DSAPrivateKey @@ -328,17 +341,22 @@ Asymmetric interfaces The bit length of the modulus. - .. attribute:: x - :type: int +.. class:: DSAPrivateKeyWithNumbers - The private key. + .. versionadded:: 0.5 - .. attribute:: y + Extends :class:`DSAPrivateKey`. - :type: int + .. method:: private_numbers() + + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateNumbers` + object. - The public key. + :returns: A + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPrivateNumbers` + instance. .. class:: DSAPublicKey @@ -353,12 +371,6 @@ Asymmetric interfaces The bit length of the modulus. - .. attribute:: y - - :type: int - - The public key. - .. method:: parameters() :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParameters` @@ -387,6 +399,23 @@ Asymmetric interfaces :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext` +.. class:: DSAPublicKeyWithNumbers + + .. versionadded:: 0.5 + + Extends :class:`DSAPublicKey`. + + .. method:: private_numbers() + + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers` + object. + + :returns: A + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers` + instance. + + .. class:: EllipticCurve .. versionadded:: 0.5 @@ -407,6 +436,9 @@ Asymmetric interfaces The bit length of the curve's base point. +Elliptic Curve +~~~~~~~~~~~~~~ + .. class:: EllipticCurveSignatureAlgorithm .. versionadded:: 0.5 @@ -475,42 +507,8 @@ Asymmetric interfaces The elliptic curve for this key. -.. class:: AsymmetricSignatureContext - - .. versionadded:: 0.2 - - .. method:: update(data) - - :param bytes data: The data you want to sign. - - .. method:: finalize() - - :return bytes signature: The signature. - - -.. class:: AsymmetricVerificationContext - - .. versionadded:: 0.2 - - .. 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. - - -.. class:: AsymmetricPadding - - .. versionadded:: 0.2 - - .. attribute:: name - - Hash algorithms -~~~~~~~~~~~~~~~ +--------------- .. class:: HashAlgorithm @@ -556,7 +554,7 @@ Hash algorithms Key derivation functions -~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------ .. class:: KeyDerivationFunction @@ -601,7 +599,7 @@ Key derivation functions `CMAC`_ -~~~~~~~ +------- .. class:: CMACContext |