From 02ebc7a14fbc33042d585edce6abcdc8e16f82f7 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 17 Mar 2014 12:12:31 +0200 Subject: Add key_size property to DSAPublicKey --- cryptography/hazmat/primitives/interfaces.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 3824bcde..eab48b4d 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -366,6 +366,12 @@ class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def key_size(self): + """ + The bit length of the prime modulus. + """ + @abc.abstractproperty def y(self): """ -- cgit v1.2.3 From edacb14ad951431da178fbe238b858c2095bc239 Mon Sep 17 00:00:00 2001 From: Mohammed Attia Date: Mon, 17 Mar 2014 12:28:23 +0200 Subject: Update the docs. --- docs/hazmat/primitives/interfaces.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index cc2a3000..cefd81ac 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -323,7 +323,13 @@ Asymmetric Interfaces .. versionadded:: 0.3 - A `DSA`_ private key. + A `DSA`_ public key. + + .. attribute:: key_size + + :type: int + + The bit length of the modulus. .. method:: parameters() -- cgit v1.2.3