Provide Backend Specific RSA Keys

This PR is dependent on #1115.

Subsequent PRs will deprecate `RSAPrivateKey`, `RSAPublicKey`, and some `RSBackend` methods  as well as move some backend methods around for encrypt/decrypt. This PR creates backend specific classes. The PR is large mostly because I moved a bunch of tests to a new deprecated class so it'll be easier for us to remove them when the time comes.

Refs #1026.
Ok, I guess that's reasonable then.


On Wed, Jun 11, 2014 at 4:46 PM, Paul Kehrer <notifications@github.com>
wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > +    def __init__(self, backend, rsa_cdata):
> > +        self._backend = backend
> > +        self._rsa_cdata = rsa_cdata
> > +
> > +        evp_pkey = self._backend._lib.EVP_PKEY_new()
> > +        assert evp_pkey != self._backend._ffi.NULL
> > +        evp_pkey = self._backend._ffi.gc(
> > +            evp_pkey, self._backend._lib.EVP_PKEY_free
> > +        )
> > +        res = self._backend._lib.EVP_PKEY_set1_RSA(evp_pkey, rsa_cdata)
> > +        assert res == 1
> > +        self._evp_pkey = evp_pkey
> > +
> > +        self.key_size = self._backend._lib.BN_num_bits(self._rsa_cdata.n)
> > +
> > +    def signer(self, padding, algorithm):
>
> I have no real problem with adding an ignored backend, but it's probably
> worth noting that no existing callers could ever get this object. Anyone
> using the 0.4 API can only obtain an rsa.RSAPrivateKey object via __init__
> or the generate classmethod. Both of those still return the concrete
> rsa.RSAPrivateKey instance that takes backend as an argument. Only people
> using the new load or generate functions will receive the new backend
> specific key object.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1116/files#r13680830>.
>



-- 
"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