aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-17 07:09:19 -0430
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-17 07:09:19 -0430
commitb125fef80dbfd8cd2d8155987f67ed0125edeed1 (patch)
tree5e15e9c135378d0b5c7ccc749cc20c33da1cd2a4
parente1bf0f821add8461e6fcee57fdc6e17280970c2d (diff)
parentedacb14ad951431da178fbe238b858c2095bc239 (diff)
downloadcryptography-b125fef80dbfd8cd2d8155987f67ed0125edeed1.tar.gz
cryptography-b125fef80dbfd8cd2d8155987f67ed0125edeed1.tar.bz2
cryptography-b125fef80dbfd8cd2d8155987f67ed0125edeed1.zip
Merge pull request #816 from skeuomorf/interface
Add key_size property to DSAPublicKey
-rw-r--r--cryptography/hazmat/primitives/interfaces.py6
-rw-r--r--docs/hazmat/primitives/interfaces.rst8
2 files changed, 13 insertions, 1 deletions
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
@@ -367,6 +367,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):
"""
The public key.
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()