I guess we can't do anything sensible in terms of modulus size then. We
certainly need to exclude `e=1` and other such nonsense though.


On Wed, Feb 5, 2014 at 10:54 AM, Alex Stapleton <notifications@github.com>wrote:

> In cryptography/hazmat/primitives/asymmetric/rsa.py:
>
> > +        return x.bit_length()
> > +    except AttributeError:
> > +        return len(bin(x)) - (2 + (x <= 0))
> > +
> > +
> > +@utils.register_interface(interfaces.RSAPublicKey)
> > +class RSAPublicKey(object):
> > +    def __init__(self, public_exponent, modulus):
> > +        if (
> > +            not isinstance(public_exponent, six.integer_types) or
> > +            not isinstance(modulus, six.integer_types)
> > +        ):
> > +            raise TypeError("RSAPublicKey arguments must be integers")
> > +
> > +        self._public_exponent = public_exponent
> > +        self._modulus = modulus
>
> Any suggestions? PKCS #1 <https://github.com/pyca/cryptography/pull/1>doesn't really put any restrictions on what's acceptable. OpenSSL will
> happily generate you even a 1-bit RSA key in more recent versions :-/
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/559/files#r9472813>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084