Example #1
0
    def test_from_invalid_secret_exponent(self, invalid_exponents):

        for exponent in invalid_exponents:
            with raises(privkey.InvalidExponent):
                PrivateKey.from_secret_exponent(exponent)
Example #2
0
    def test_from_secret_exponent(self, valid_exponents):

        for exponent in valid_exponents:
            k = PrivateKey.from_secret_exponent(exponent)
            assert k.key.private_numbers().private_value == exponent