From d0b0c73d1d87423f4a63ba05ab4cf1f290a5af02 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 16:27:07 +0200 Subject: Add DSA interfaces --- cryptography/hazmat/primitives/interfaces.py | 188 +++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 11696160..663f9655 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -287,6 +287,194 @@ class RSAPublicKey(six.with_metaclass(abc.ABCMeta)): """ +class DSAParams(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def modulus(self): + """ + The prime modulus that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def divisor(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def generator(self): + """ + The generator that is used in generating the DSA keypair. + """ + + @abc.abstractmethod + def generate(self): + """ + Generate DSAPrivateKey from the object's parameters + """ + + @abc.abstractproperty + def p(self): + """ + The prime modulus that's used in generating the DSA keypair. + Alias for modulus. + """ + + @abc.abstractproperty + def q(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + Alias for divisor. + """ + + @abc.abstractproperty + def g(self): + """ + The generator that is used in generating the DSA keypair. + Alias for generator. + """ + + +class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def modulus(self): + """ + The prime modulus that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def divisor(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def generator(self): + """ + The generator that is used in generating the DSA keypair. + """ + + @abc.abstractproperty + def modulus_length(self): + """ + The bit length of the prime modulus. + """ + + @abc.abstractproperty + def divisor_length(self): + """ + The bit length of the divisor. + """ + + @abc.abstractproperty + def priv_key(self): + """ + The private key in the DSA structure. + """ + + @abc.abstractproperty + def public_key(self): + """ + The DSAPublicKey associated with this private key. + """ + + @abc.abstractproperty + def p(self): + """ + The prime modulus that's used in generating the DSA keypair. + Alias for modulus. + """ + + @abc.abstractproperty + def q(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + Alias for divisor. + """ + + @abc.abstractproperty + def g(self): + """ + The generator that is used in generating the DSA keypair. + Alias for generator. + """ + + @abc.abstractproperty + def L(self): + """ + The bit length of the prime modulus. Alias for modulus_length. + """ + + @abc.abstractproperty + def N(self): + """ + The bit length of the divisor. Alias for divisor_length. + """ + + @abc.abstractproperty + def y(self): + """ + The DSAPublicKey associated with this private key. + Alias for public_key. + """ + + @abc.abstractproperty + def params(self): + """ + The params associated with a DSA keypair + """ + + +class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def modulus(self): + """ + The prime modulus that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def divisor(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def generator(self): + """ + The generator that is used in generating the DSA keypair. + """ + + @abc.abstractproperty + def pub_key(self): + """ + The pub_key that's in the DSA structure, also known as y. + """ + @abc.abstractproperty + def p(self): + """ + The prime modulus that's used in generating the DSA keypair. + Alias for modulus. + """ + + @abc.abstractproperty + def q(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + Alias for divisor. + """ + + @abc.abstractproperty + def g(self): + """ + The generator that is used in generating the DSA keypair. + Alias for generator. + """ + + @abc.abstractproperty + def params(self): + """ + The params associated with a DSA keypair + """ + class AsymmetricSignatureContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): -- cgit v1.2.3 From 14a1f2dbf7ddd58b709a27c7a2ed9ae6a2c88d0e Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 16:41:56 +0200 Subject: Change public_key from abstractproperty to abstractmethod --- cryptography/hazmat/primitives/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 663f9655..3d345a99 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -371,7 +371,7 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The private key in the DSA structure. """ - @abc.abstractproperty + @abc.abstractmethod def public_key(self): """ The DSAPublicKey associated with this private key. -- cgit v1.2.3 From 7470453ee9264c6c76f678220bc1b812d194b9df Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 16:49:59 +0200 Subject: fix pep8 errors --- cryptography/hazmat/primitives/interfaces.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 3d345a99..ba6436e0 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -475,6 +475,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): The params associated with a DSA keypair """ + class AsymmetricSignatureContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): -- cgit v1.2.3 From 9db8dbab26d72e842ae1f5f9073a539b2795f4d5 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 17:36:00 +0200 Subject: Change property names to be consistent with RSA --- cryptography/hazmat/primitives/interfaces.py | 81 +--------------------------- 1 file changed, 2 insertions(+), 79 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index ba6436e0..589b7484 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -336,31 +336,13 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty - def modulus(self): - """ - The prime modulus that's used in generating the DSA keypair. - """ - - @abc.abstractproperty - def divisor(self): - """ - The prime divisor of (p-1) that's used in generating the DSA keypair. - """ - - @abc.abstractproperty - def generator(self): - """ - The generator that is used in generating the DSA keypair. - """ - - @abc.abstractproperty - def modulus_length(self): + def key_size(self): """ The bit length of the prime modulus. """ @abc.abstractproperty - def divisor_length(self): + def divisor_size(self): """ The bit length of the divisor. """ @@ -377,27 +359,6 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The DSAPublicKey associated with this private key. """ - @abc.abstractproperty - def p(self): - """ - The prime modulus that's used in generating the DSA keypair. - Alias for modulus. - """ - - @abc.abstractproperty - def q(self): - """ - The prime divisor of (p-1) that's used in generating the DSA keypair. - Alias for divisor. - """ - - @abc.abstractproperty - def g(self): - """ - The generator that is used in generating the DSA keypair. - Alias for generator. - """ - @abc.abstractproperty def L(self): """ @@ -425,49 +386,11 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): - @abc.abstractproperty - def modulus(self): - """ - The prime modulus that's used in generating the DSA keypair. - """ - - @abc.abstractproperty - def divisor(self): - """ - The prime divisor of (p-1) that's used in generating the DSA keypair. - """ - - @abc.abstractproperty - def generator(self): - """ - The generator that is used in generating the DSA keypair. - """ - @abc.abstractproperty def pub_key(self): """ The pub_key that's in the DSA structure, also known as y. """ - @abc.abstractproperty - def p(self): - """ - The prime modulus that's used in generating the DSA keypair. - Alias for modulus. - """ - - @abc.abstractproperty - def q(self): - """ - The prime divisor of (p-1) that's used in generating the DSA keypair. - Alias for divisor. - """ - - @abc.abstractproperty - def g(self): - """ - The generator that is used in generating the DSA keypair. - Alias for generator. - """ @abc.abstractproperty def params(self): -- cgit v1.2.3 From ed2172b5c21879b03fce52976d26ba899128c163 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 20:19:58 +0200 Subject: Remove bitlength related properties that are not needed --- cryptography/hazmat/primitives/interfaces.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 589b7484..e81abfb7 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -309,7 +309,7 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def generate(self): """ - Generate DSAPrivateKey from the object's parameters + Generate DSAPrivateKey from the object's parameters. """ @abc.abstractproperty @@ -341,12 +341,6 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The bit length of the prime modulus. """ - @abc.abstractproperty - def divisor_size(self): - """ - The bit length of the divisor. - """ - @abc.abstractproperty def priv_key(self): """ @@ -359,18 +353,6 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The DSAPublicKey associated with this private key. """ - @abc.abstractproperty - def L(self): - """ - The bit length of the prime modulus. Alias for modulus_length. - """ - - @abc.abstractproperty - def N(self): - """ - The bit length of the divisor. Alias for divisor_length. - """ - @abc.abstractproperty def y(self): """ -- cgit v1.2.3 From 984b38696e1f34ebca44fe9c605564eaf4f442bf Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 20:24:01 +0200 Subject: Changed docstrings to conform to lastest updates of the interfaces --- cryptography/hazmat/primitives/interfaces.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index e81abfb7..bca8d544 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -356,14 +356,13 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def y(self): """ - The DSAPublicKey associated with this private key. - Alias for public_key. + The integer value of y. """ @abc.abstractproperty def params(self): """ - The params associated with a DSA keypair + The DSAParams object associated with this private key. """ @@ -377,7 +376,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def params(self): """ - The params associated with a DSA keypair + The DSAParams object associated with this public key. """ -- cgit v1.2.3 From c63092d7555b7943a3de04854ca89c0aa262e905 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 20:27:58 +0200 Subject: Fixed typo --- cryptography/hazmat/primitives/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index bca8d544..ee54aafe 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -370,7 +370,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def pub_key(self): """ - The pub_key that's in the DSA structure, also known as y. + The pub_key that's in the DSA structure. """ @abc.abstractproperty -- cgit v1.2.3 From 61b47b989dc87cdc760c9d297fd45f219b64efd1 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 20:49:23 +0200 Subject: Change pub_key and priv_key to y and x respectively --- cryptography/hazmat/primitives/interfaces.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index ee54aafe..4d9e7879 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -341,18 +341,18 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The bit length of the prime modulus. """ - @abc.abstractproperty - def priv_key(self): - """ - The private key in the DSA structure. - """ - @abc.abstractmethod def public_key(self): """ The DSAPublicKey associated with this private key. """ + @abc.abstractproperty + def x(self): + """ + The private key "x" in the DSA structure. + """ + @abc.abstractproperty def y(self): """ @@ -368,9 +368,9 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty - def pub_key(self): + def y(self): """ - The pub_key that's in the DSA structure. + The integer value of y. """ @abc.abstractproperty -- cgit v1.2.3 From 441db5033a67e30f0e392f82ae70334a6fc3feff Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 21:12:44 +0200 Subject: Change name of divisor to subgroup_order --- cryptography/hazmat/primitives/interfaces.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 4d9e7879..04537f8c 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -295,9 +295,10 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): """ @abc.abstractproperty - def divisor(self): + def subgroup_order(self): """ - The prime divisor of (p-1) that's used in generating the DSA keypair. + The subgroup order that's used in generating the DSA keypair + by the generator. """ @abc.abstractproperty @@ -322,8 +323,9 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def q(self): """ - The prime divisor of (p-1) that's used in generating the DSA keypair. - Alias for divisor. + The subgroup order that's used in generating the DSA keypair + by the generator. + Alias for subgroup_order. """ @abc.abstractproperty -- cgit v1.2.3 From 7ad280cbe954a2769956c846aaa0112d43a550c9 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 21:33:39 +0200 Subject: Fix pep8 issues --- cryptography/hazmat/primitives/interfaces.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 04537f8c..3ffe09f1 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -297,7 +297,7 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def subgroup_order(self): """ - The subgroup order that's used in generating the DSA keypair + The subgroup order that's used in generating the DSA keypair by the generator. """ @@ -323,7 +323,7 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def q(self): """ - The subgroup order that's used in generating the DSA keypair + The subgroup order that's used in generating the DSA keypair by the generator. Alias for subgroup_order. """ -- cgit v1.2.3 From 4d9382c610963cf0b21d11014f6f6234b522f85b Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 23:01:27 +0200 Subject: Fix DSAParams generate method to eliminate ambiguity --- cryptography/hazmat/primitives/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 3ffe09f1..828a801a 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -310,7 +310,7 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def generate(self): """ - Generate DSAPrivateKey from the object's parameters. + Generate DSA domain parameters. """ @abc.abstractproperty -- cgit v1.2.3 From c2ea0fb9694b663faf13fcf418062706ffca8054 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 3 Mar 2014 23:48:15 +0200 Subject: Change params to parameters --- cryptography/hazmat/primitives/interfaces.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 828a801a..a8956b85 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -362,7 +362,7 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): """ @abc.abstractproperty - def params(self): + def parameters(self): """ The DSAParams object associated with this private key. """ @@ -376,7 +376,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): """ @abc.abstractproperty - def params(self): + def parameters(self): """ The DSAParams object associated with this public key. """ -- cgit v1.2.3 From a4e95af4b7f871822d1e9af9aa968de0b45e42e4 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 00:08:20 +0200 Subject: More accurate docstring --- cryptography/hazmat/primitives/interfaces.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index a8956b85..bfe9c1da 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -291,20 +291,23 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def modulus(self): """ - The prime modulus that's used in generating the DSA keypair. + The prime modulus that's used in generating the DSA keypair and used + in the DSA signing and verification processes. """ @abc.abstractproperty def subgroup_order(self): """ The subgroup order that's used in generating the DSA keypair - by the generator. + by the generator and used in the DSA signing and verification + processes. """ @abc.abstractproperty def generator(self): """ - The generator that is used in generating the DSA keypair. + The generator that is used in generating the DSA keypair and used + in the DSA signing and verification processes." """ @abc.abstractmethod @@ -316,23 +319,23 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def p(self): """ - The prime modulus that's used in generating the DSA keypair. - Alias for modulus. + The prime modulus that's used in generating the DSA keypair and used + in the DSA signing and verification processes. Alias for modulus. """ @abc.abstractproperty def q(self): """ The subgroup order that's used in generating the DSA keypair - by the generator. - Alias for subgroup_order. + by the generator and used in the DSA signing and verification + processes. Alias for subgroup_order. """ @abc.abstractproperty def g(self): """ - The generator that is used in generating the DSA keypair. - Alias for generator. + The generator that is used in generating the DSA keypair and used + in the DSA signing and verification processes. Alias for generator. """ @@ -358,7 +361,7 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def y(self): """ - The integer value of y. + The public key. """ @abc.abstractproperty @@ -372,7 +375,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def y(self): """ - The integer value of y. + The public key. """ @abc.abstractproperty -- cgit v1.2.3 From 157a1fc9a2c057ac45738dfa5ed1cc36ce0c6cac Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 02:45:41 +0200 Subject: Remove DSAParams generate method as it will be implemented as a classmethod --- cryptography/hazmat/primitives/interfaces.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index bfe9c1da..245302e6 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -310,12 +310,6 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): in the DSA signing and verification processes." """ - @abc.abstractmethod - def generate(self): - """ - Generate DSA domain parameters. - """ - @abc.abstractproperty def p(self): """ -- cgit v1.2.3 From dada0f8e13ac12a97b75acb68cc3d4cefca2f398 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 02:57:40 +0200 Subject: Change parameters from abstractproperty to abstractmethod --- cryptography/hazmat/primitives/interfaces.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 245302e6..a6da7db1 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -358,7 +358,7 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): The public key. """ - @abc.abstractproperty + @abc.abstractmethod def parameters(self): """ The DSAParams object associated with this private key. @@ -372,7 +372,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): The public key. """ - @abc.abstractproperty + @abc.abstractmethod def parameters(self): """ The DSAParams object associated with this public key. -- cgit v1.2.3 From b416715b8ee96c445587d444a4684bc7817e4638 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 03:29:56 +0200 Subject: Added documentation for the DSA interfaces --- docs/hazmat/primitives/interfaces.rst | 107 ++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index 15ad1d1b..b119bc5b 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -231,6 +231,113 @@ Asymmetric Interfaces The public exponent. Alias for :attr:`public_exponent`. +.. class:: DSAParams + + .. versionadded:: 0.3 + + `DSA`_ parameters. + + .. attribute:: modulus + + :type: int + + The prime modulus that's used in generating the DSA keypair and used + in the DSA signing and verification processes. + + .. attribute:: subgroup_order + + :type: int + + The subgroup order that's used in generating the DSA keypair + 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 keypair and used + in the DSA signing and verification processes." + + .. attribute:: p + + :type: int + + The prime modulus that's used in generating the DSA keypair and used + in the DSA signing and verification processes. Alias for modulus. + + .. attribute:: q + + :type: int + + The subgroup order that's used in generating the DSA keypair + by the generator and used in the DSA signing and verification + processes. Alias for subgroup_order. + + .. attribute:: g + + :type: int + + The generator that is used in generating the DSA keypair and used + in the DSA signing and verification processes. Alias for generator. + + +.. class:: DSAPrivateKey + + .. versionadded:: 0.3 + + An `DSA`_ private key. + + .. method:: public_key() + + :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAPublicKey` + + An DSA public key object corresponding to the values of the private key. + + .. method:: parameters() + + :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParams` + + The DSAParams object associated with this private key. + + .. attribute:: key_size + + :type: int + + The bit length of the modulus. + + .. attribute:: x + + :type: int + + The private key. + + .. attribute:: y + + :type: int + + The public key. + + +.. class:: DSAPublicKey + + .. versionadded:: 0.3 + + An `DSA`_ private key. + + .. method:: parameters() + + :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParams` + + The DSAParams object associated with this public key. + + .. attribute:: y + + :type: int + + The public key. + + .. class:: AsymmetricSignatureContext .. versionadded:: 0.2 -- cgit v1.2.3 From 7032451fb442f3e4c5dd590c54aa7532b1197f5c Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 03:34:39 +0200 Subject: Annotate aliases in the DSA documentation --- docs/hazmat/primitives/interfaces.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index b119bc5b..bbaeb5e7 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -264,7 +264,7 @@ Asymmetric Interfaces :type: int The prime modulus that's used in generating the DSA keypair and used - in the DSA signing and verification processes. Alias for modulus. + in the DSA signing and verification processes. Alias for :attr:`modulus`. .. attribute:: q @@ -272,14 +272,14 @@ Asymmetric Interfaces The subgroup order that's used in generating the DSA keypair by the generator and used in the DSA signing and verification - processes. Alias for subgroup_order. + processes. Alias for :attr:`subgroup_order`. .. attribute:: g :type: int The generator that is used in generating the DSA keypair and used - in the DSA signing and verification processes. Alias for generator. + in the DSA signing and verification processes. Alias for :attr:`generator`. .. class:: DSAPrivateKey -- cgit v1.2.3 From 604c78f75ca1c0a5b6a340dd5067182487f1b65d Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 03:56:08 +0200 Subject: Define DSA in the documentation --- docs/hazmat/primitives/interfaces.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index bbaeb5e7..2ea4b583 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -442,3 +442,4 @@ Key Derivation Functions .. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem) .. _`Chinese remainder theorem`: https://en.wikipedia.org/wiki/Chinese_remainder_theorem +.. _`DSA`: https://en.wikipedia.org/wiki/Digital_Signature_Algorithm -- cgit v1.2.3 From cb9a6c24ea2165b25e4129a440871ce7bcab3de4 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 04:16:35 +0200 Subject: Change keypair to key pair to pass the sphinx spelling test --- docs/hazmat/primitives/interfaces.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index 2ea4b583..c1a2d23a 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -241,14 +241,14 @@ Asymmetric Interfaces :type: int - The prime modulus that's used in generating the DSA keypair and used + The prime modulus that's 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's used in generating the DSA keypair + The subgroup order that's used in generating the DSA key pair by the generator and used in the DSA signing and verification processes. @@ -256,21 +256,21 @@ Asymmetric Interfaces :type: int - The generator that is used in generating the DSA keypair and used + 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's used in generating the DSA keypair and used + The prime modulus that's used in generating the DSA key pair and used in the DSA signing and verification processes. Alias for :attr:`modulus`. .. attribute:: q :type: int - The subgroup order that's used in generating the DSA keypair + The subgroup order that's used in generating the DSA key pair by the generator and used in the DSA signing and verification processes. Alias for :attr:`subgroup_order`. @@ -278,7 +278,7 @@ Asymmetric Interfaces :type: int - The generator that is used in generating the DSA keypair and used + The generator that is used in generating the DSA key pair and used in the DSA signing and verification processes. Alias for :attr:`generator`. -- cgit v1.2.3 From 7a1738a1b8b3da2a215f2ea3aff73a67eaaab406 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 19:17:24 +0200 Subject: Typo fixes --- cryptography/hazmat/primitives/interfaces.py | 2 +- docs/hazmat/primitives/interfaces.rst | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index a6da7db1..07e88e26 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -307,7 +307,7 @@ class DSAParams(six.with_metaclass(abc.ABCMeta)): def generator(self): """ The generator that is used in generating the DSA keypair and used - in the DSA signing and verification processes." + in the DSA signing and verification processes. """ @abc.abstractproperty diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index c1a2d23a..d94aee83 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -241,14 +241,14 @@ Asymmetric Interfaces :type: int - The prime modulus that's used in generating the DSA key pair and used + 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's used in generating the DSA key pair + The subgroup order that is used in generating the DSA key pair by the generator and used in the DSA signing and verification processes. @@ -257,20 +257,20 @@ Asymmetric Interfaces :type: int The generator that is used in generating the DSA key pair and used - in the DSA signing and verification processes." + in the DSA signing and verification processes. .. attribute:: p :type: int - The prime modulus that's used in generating the DSA key pair and used + 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 - The subgroup order that's used in generating the DSA key pair + 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`. @@ -286,7 +286,7 @@ Asymmetric Interfaces .. versionadded:: 0.3 - An `DSA`_ private key. + A `DSA`_ private key. .. method:: public_key() @@ -323,7 +323,7 @@ Asymmetric Interfaces .. versionadded:: 0.3 - An `DSA`_ private key. + A `DSA`_ private key. .. method:: parameters() -- cgit v1.2.3 From 71acc67e71013f8660a16d78520da22ec379e259 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Tue, 4 Mar 2014 19:20:45 +0200 Subject: Change DSAParams to DSAParameters --- cryptography/hazmat/primitives/interfaces.py | 6 +++--- docs/hazmat/primitives/interfaces.rst | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 07e88e26..3824bcde 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -287,7 +287,7 @@ class RSAPublicKey(six.with_metaclass(abc.ABCMeta)): """ -class DSAParams(six.with_metaclass(abc.ABCMeta)): +class DSAParameters(six.with_metaclass(abc.ABCMeta)): @abc.abstractproperty def modulus(self): """ @@ -361,7 +361,7 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def parameters(self): """ - The DSAParams object associated with this private key. + The DSAParameters object associated with this private key. """ @@ -375,7 +375,7 @@ class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def parameters(self): """ - The DSAParams object associated with this public key. + The DSAParameters object associated with this public key. """ diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index d94aee83..cc2a3000 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -231,7 +231,7 @@ Asymmetric Interfaces The public exponent. Alias for :attr:`public_exponent`. -.. class:: DSAParams +.. class:: DSAParameters .. versionadded:: 0.3 @@ -296,9 +296,9 @@ Asymmetric Interfaces .. method:: parameters() - :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParams` + :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParameters` - The DSAParams object associated with this private key. + The DSAParameters object associated with this private key. .. attribute:: key_size @@ -327,9 +327,9 @@ Asymmetric Interfaces .. method:: parameters() - :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParams` + :return: :class:`~cryptography.hazmat.primitives.interfaces.DSAParameters` - The DSAParams object associated with this public key. + The DSAParameters object associated with this public key. .. attribute:: y -- cgit v1.2.3