Initial public key loading work

- [x] I think the use of PKCS8/PEM might be wrong?
- [x] Docs
- [x] Tests (need vectors, where do they come from? Just re-process the private keys?)
- [x] Still a bit too much code duplication
Do we have an open ticket to track this?


On Thu, Sep 11, 2014 at 8:52 AM, Alex Stapleton <notifications@github.com>
wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > +        Return the approrpiate type of PublicKey given an evp_pkey cdata
> > +        pointer.
> > +        """
> > +        type = evp_pkey.type
> > +
> > +        if type == self._lib.EVP_PKEY_RSA:
> > +            rsa_cdata = self._lib.EVP_PKEY_get1_RSA(evp_pkey)
> > +            assert rsa_cdata != self._ffi.NULL
> > +            rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
> > +            return _RSAPublicKey(self, rsa_cdata)
> > +        elif type == self._lib.EVP_PKEY_DSA:
> > +            dsa_cdata = self._lib.EVP_PKEY_get1_DSA(evp_pkey)
> > +            assert dsa_cdata != self._ffi.NULL
> > +            dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
> > +            return _DSAPublicKey(self, dsa_cdata)
> > +        else:
>
> I think mostly just not getting around to it. OpenSSL is capable of
> handling serialised EC keys about as well as anything else IIRC.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1233/files#r17429231>.
>



-- 
"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