aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-07-12 11:57:45 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-07-12 11:57:45 -0500
commitb3d62ad126bcc974ba3265c9ecaaf752c2ef08d4 (patch)
tree1286b1d34cbc299d2432d708cb9eb7f3a4ac1309 /src
parent548e85ed63964c38fd450a4ee8753a5be2c956d5 (diff)
downloadcryptography-b3d62ad126bcc974ba3265c9ecaaf752c2ef08d4.tar.gz
cryptography-b3d62ad126bcc974ba3265c9ecaaf752c2ef08d4.tar.bz2
cryptography-b3d62ad126bcc974ba3265c9ecaaf752c2ef08d4.zip
Fixed #2143 -- added __hash__ to RSA{Public,Private}Numbers
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/rsa.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
index 89eac4d4..41b0089e 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -307,6 +307,17 @@ class RSAPrivateNumbers(object):
def __ne__(self, other):
return not self == other
+ def __hash__(self):
+ return hash((
+ self.p,
+ self.q,
+ self.d,
+ self.dmp1,
+ self.dmq1,
+ self.iqmp,
+ self.public_numbers,
+ ))
+
class RSAPublicNumbers(object):
def __init__(self, e, n):
@@ -336,3 +347,6 @@ class RSAPublicNumbers(object):
def __ne__(self, other):
return not self == other
+
+ def __hash__(self):
+ return hash((self.e, self.n))