aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-09-12 19:47:39 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-09-12 19:47:39 -0500
commit5f47335ce58b7ea31a39ece81e3ff8e523f80168 (patch)
treeb485d9cb85e41f913964f059ef1f3008a2bebd37 /cryptography
parentb8599c085d3e295f460f0117f7df9288a4841d7f (diff)
parentacda0445b1d22da120bbd46283e374887758c8b2 (diff)
downloadcryptography-5f47335ce58b7ea31a39ece81e3ff8e523f80168.tar.gz
cryptography-5f47335ce58b7ea31a39ece81e3ff8e523f80168.tar.bz2
cryptography-5f47335ce58b7ea31a39ece81e3ff8e523f80168.zip
Merge pull request #1328 from michael-hart/master
Implemented support for loading EC private keys
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index d1d18a10..7e619a10 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -473,6 +473,12 @@ class Backend(object):
assert dsa_cdata != self._ffi.NULL
dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
return _DSAPrivateKey(self, dsa_cdata)
+ elif self._lib.Cryptography_HAS_EC == 1 \
+ and type == self._lib.EVP_PKEY_EC:
+ ec_cdata = self._lib.EVP_PKEY_get1_EC_KEY(evp_pkey)
+ assert ec_cdata != self._ffi.NULL
+ ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
+ return _EllipticCurvePrivateKey(self, ec_cdata, None)
else:
raise UnsupportedAlgorithm("Unsupported key type.")