diff options
Diffstat (limited to 'tests/hazmat')
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 63d62657..9d696238 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1483,3 +1483,30 @@ class TestRSAEncryption(object): ), backend ) + + +class TestRSANumbers(object): + def test_RSAPublicNumbers(self): + public_numbers = rsa.RSAPublicNumbers(e=1, n=15) + assert public_numbers.e == 1 + assert public_numbers.n == 15 + + def test_RSAPrivateNumbers(self): + public_numbers = rsa.RSAPublicNumbers(e=1, n=15) + private_numbers = rsa.RSAPrivateNumbers( + p=3, + q=5, + d=1, + dmp1=1, + dmq1=1, + iqmp=2, + public_numbers=public_numbers + ) + + assert private_numbers.p == 3 + assert private_numbers.q == 5 + assert private_numbers.d == 1 + assert private_numbers.dmp1 == 1 + assert private_numbers.dmq1 == 1 + assert private_numbers.iqmp == 2 + assert private_numbers.public_numbers() == public_numbers |