[WIP] Add unencrypted PEM PKCS8 dumping support

Adds unencrypted PEM dumping for private keys. Public keys and encrypted (PBE) support will be in separate PRs (and PBE requires some discussion. I tried to dig up the issue we've used for this in the past but couldn't find it)
k

On Wed, Oct 1, 2014 at 2:29 PM, Paul Kehrer <notifications@github.com>
wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > +            assert res == 1
> > +        elif isinstance(key, _EllipticCurvePrivateKey):
> > +            evp_pkey = self._lib.EVP_PKEY_new()
> > +            assert evp_pkey != self._ffi.NULL
> > +            evp_pkey = self._ffi.gc(
> > +                evp_pkey, self._lib.EVP_PKEY_free
> > +            )
> > +            res = self._lib.EVP_PKEY_set1_EC_KEY(
> > +                evp_pkey, key._ec_key
> > +            )
> > +            assert res == 1
> > +        else:
> > +            raise UnsupportedAlgorithm(
> > +                "Unsupported key type",
> > +                _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM
> > +            )
>
> We have #1231 <https://github.com/pyca/cryptography/issues/1231> to track
> adding EVP_PKEY objects to all OpenSSL asym backend objects. I'll
> probably look at doing that in the next few days if no one else gets to it
> first.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1380/files#r18309392>.
>



-- 
"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