diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-06 16:54:17 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-06 16:54:17 -0500 |
commit | 0cf031cd137778228c091665785816b2c8a3ccd4 (patch) | |
tree | 8b12580fb02e4028b2aaf8c4bd2e470a6ad7c379 | |
parent | f1de2f78cfd2b19eb4e2485ff36008581b088292 (diff) | |
download | cryptography-0cf031cd137778228c091665785816b2c8a3ccd4.tar.gz cryptography-0cf031cd137778228c091665785816b2c8a3ccd4.tar.bz2 cryptography-0cf031cd137778228c091665785816b2c8a3ccd4.zip |
remove raw numbers properties from the RSA*Key interfaces
refs #1026. Concrete class (that will be deprecated in another PR)
still possesses them for backwards compatibility purposes.
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 94 | ||||
-rw-r--r-- | docs/hazmat/primitives/interfaces.rst | 93 |
2 files changed, 0 insertions, 187 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 0dd1d01a..d805bd1a 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -192,24 +192,6 @@ class RSAPrivateKey(object): """ @abc.abstractproperty - def modulus(self): - """ - The public modulus of the RSA key. - """ - - @abc.abstractproperty - def public_exponent(self): - """ - The public exponent of the RSA key. - """ - - @abc.abstractproperty - def private_exponent(self): - """ - The private exponent of the RSA key. - """ - - @abc.abstractproperty def key_size(self): """ The bit length of the public modulus. @@ -221,58 +203,6 @@ class RSAPrivateKey(object): The RSAPublicKey associated with this private key. """ - @abc.abstractproperty - def n(self): - """ - The public modulus of the RSA key. Alias for modulus. - """ - - @abc.abstractproperty - def p(self): - """ - One of the two primes used to generate d. - """ - - @abc.abstractproperty - def q(self): - """ - One of the two primes used to generate d. - """ - - @abc.abstractproperty - def d(self): - """ - The private exponent. This can be calculated using p and q. Alias for - private_exponent. - """ - - @abc.abstractproperty - def dmp1(self): - """ - A Chinese remainder theorem coefficient used to speed up RSA - calculations. Calculated as: d mod (p-1) - """ - - @abc.abstractproperty - def dmq1(self): - """ - A Chinese remainder theorem coefficient used to speed up RSA - calculations. Calculated as: d mod (q-1) - """ - - @abc.abstractproperty - def iqmp(self): - """ - A Chinese remainder theorem coefficient used to speed up RSA - calculations. The modular inverse of q modulo p - """ - - @abc.abstractproperty - def e(self): - """ - The public exponent of the RSA key. Alias for public_exponent. - """ - @six.add_metaclass(abc.ABCMeta) class RSAPublicKey(object): @@ -283,35 +213,11 @@ class RSAPublicKey(object): """ @abc.abstractproperty - def modulus(self): - """ - The public modulus of the RSA key. - """ - - @abc.abstractproperty - def public_exponent(self): - """ - The public exponent of the RSA key. - """ - - @abc.abstractproperty def key_size(self): """ The bit length of the public modulus. """ - @abc.abstractproperty - def n(self): - """ - The public modulus of the RSA key. Alias for modulus. - """ - - @abc.abstractproperty - def e(self): - """ - The public exponent of the RSA key. Alias for public_exponent. - """ - @six.add_metaclass(abc.ABCMeta) class DSAParameters(object): diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst index b2857f58..34e4e938 100644 --- a/docs/hazmat/primitives/interfaces.rst +++ b/docs/hazmat/primitives/interfaces.rst @@ -157,81 +157,12 @@ Asymmetric interfaces An RSA public key object corresponding to the values of the private key. - .. attribute:: modulus - - :type: int - - The public modulus. - - .. attribute:: public_exponent - - :type: int - - The public exponent. - - .. attribute:: private_exponent - - :type: int - - The private exponent. - .. attribute:: key_size :type: int The bit length of the modulus. - .. attribute:: p - - :type: int - - ``p``, one of the two primes composing the :attr:`modulus`. - - .. attribute:: q - - :type: int - - ``q``, one of the two primes composing the :attr:`modulus`. - - .. attribute:: d - - :type: int - - The private exponent. Alias for :attr:`private_exponent`. - - .. attribute:: dmp1 - - :type: int - - A `Chinese remainder theorem`_ coefficient used to speed up RSA - operations. Calculated as: d mod (p-1) - - .. attribute:: dmq1 - - :type: int - - A `Chinese remainder theorem`_ coefficient used to speed up RSA - operations. Calculated as: d mod (q-1) - - .. attribute:: iqmp - - :type: int - - A `Chinese remainder theorem`_ coefficient used to speed up RSA - operations. Calculated as: q\ :sup:`-1` mod p - - .. attribute:: n - - :type: int - - The public modulus. Alias for :attr:`modulus`. - - .. attribute:: e - - :type: int - - The public exponent. Alias for :attr:`public_exponent`. - .. class:: RSAPublicKey @@ -281,36 +212,12 @@ Asymmetric interfaces :return bytes: Encrypted data. - .. attribute:: modulus - - :type: int - - The public modulus. - .. attribute:: key_size :type: int The bit length of the modulus. - .. attribute:: public_exponent - - :type: int - - The public exponent. - - .. attribute:: n - - :type: int - - The public modulus. Alias for :attr:`modulus`. - - .. attribute:: e - - :type: int - - The public exponent. Alias for :attr:`public_exponent`. - .. class:: DSAParameters |