From 59edb613d278bb93dc165e486f354b69fc12fdee Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Fri, 25 Apr 2014 22:44:40 +0200 Subject: Add DSA verification docs --- docs/hazmat/backends/interfaces.rst | 32 ++++++++++++++++++++++++++++++++ docs/hazmat/backends/openssl.rst | 1 + 2 files changed, 33 insertions(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 2f63f3e0..e0937f97 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -345,6 +345,38 @@ A specific ``backend`` may provide one or more of these interfaces. 1.0.0 and the key size is larger than 1024; older OpenSSL versions do not support keys larger than 1024 bits. + .. method:: create_dsa_verification_ctx(public_key, signature, algorithm) + + :param public_key: An instance of a + :class:`~cryptography.hazmat.primitives.interfaces.DSAPublicKey` + provider. + + :param bytes signature: The signature to verify. + + :param algorithm: An instance of a + :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` + provider. + + :returns: + :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext` + + .. method:: dsa_signature_from_components(r, s) + + :param int r: The r value which is part of a DSA signature. + + :param int s: The s value which is part of a DSA signature. + + :returns: A DSA signature in DER format. + + .. method:: dsa_hash_supported(algorithm): + + :param algorithm: An instance of a + :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` + provider. + + :returns: ``True`` if the specified ``algorithm`` is supported by this + backend, otherwise ``False``. + .. class:: CMACBackend diff --git a/docs/hazmat/backends/openssl.rst b/docs/hazmat/backends/openssl.rst index 43e5d8f3..f15bc282 100644 --- a/docs/hazmat/backends/openssl.rst +++ b/docs/hazmat/backends/openssl.rst @@ -14,6 +14,7 @@ Red Hat Enterprise Linux 5) and greater. Earlier versions may work but are It implements the following interfaces: * :class:`~cryptography.hazmat.backends.interfaces.CipherBackend` + * :class:`~cryptography.hazmat.backends.interfaces.DSABackend` * :class:`~cryptography.hazmat.backends.interfaces.HashBackend` * :class:`~cryptography.hazmat.backends.interfaces.HMACBackend` * :class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend` -- cgit v1.2.3 From 43dc2767b8f71bce0c8c249a224ea194380c9180 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 30 Apr 2014 16:24:39 -0500 Subject: remove dsa_signature_from_components since it's no longer needed --- docs/hazmat/backends/interfaces.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index e0937f97..114b993d 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -360,16 +360,8 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext` - .. method:: dsa_signature_from_components(r, s) - - :param int r: The r value which is part of a DSA signature. - - :param int s: The s value which is part of a DSA signature. - - :returns: A DSA signature in DER format. - .. method:: dsa_hash_supported(algorithm): - + :param algorithm: An instance of a :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` provider. -- cgit v1.2.3 From b4037871574803ab8cdb59902200d2ad8a322ede Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 30 Apr 2014 16:32:23 -0500 Subject: add interface docs for dsa_params_supported --- docs/hazmat/backends/interfaces.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 114b993d..3b3d5eff 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -369,6 +369,15 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: ``True`` if the specified ``algorithm`` is supported by this backend, otherwise ``False``. + .. method:: dsa_parameters_supported(p, q): + + :param int p: The p value of a DSA key. + + :param int q: The q value of a DSA key. + + :returns: ``True`` if the given values of ``p`` and ``q`` are supported + by this backend, otherwise ``False``. + .. class:: CMACBackend -- cgit v1.2.3 From 21babbb5001cd98ed9dfbc458cbf376223ab6588 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 1 May 2014 11:33:22 -0500 Subject: updates for review feedback --- docs/hazmat/backends/interfaces.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'docs/hazmat/backends') diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 3b3d5eff..6833f221 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -351,7 +351,8 @@ A specific ``backend`` may provide one or more of these interfaces. :class:`~cryptography.hazmat.primitives.interfaces.DSAPublicKey` provider. - :param bytes signature: The signature to verify. + :param bytes signature: The signature to verify. DER encoded as + specified in :rfc:`6979`. :param algorithm: An instance of a :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` @@ -369,14 +370,16 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: ``True`` if the specified ``algorithm`` is supported by this backend, otherwise ``False``. - .. method:: dsa_parameters_supported(p, q): + .. method:: dsa_parameters_supported(p, q, g): :param int p: The p value of a DSA key. :param int q: The q value of a DSA key. - :returns: ``True`` if the given values of ``p`` and ``q`` are supported - by this backend, otherwise ``False``. + :param int g: The g value of a DSA key. + + :returns: ``True`` if the given values of ``p``, ``q``, and ``g`` are + supported by this backend, otherwise ``False``. .. class:: CMACBackend -- cgit v1.2.3