diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-14 14:17:29 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-14 14:17:29 -0400 |
commit | 939af10558eccce22e72fafceb7eb4f32d8cea2f (patch) | |
tree | daa6dfa76c2b908ced2247bda7bc2e2c92ee0279 /src | |
parent | 7905fcec68fd633d0b28d371660123b7b22cca53 (diff) | |
parent | 81d069d3100bbdf1a612e01dfb71687ec0d84110 (diff) | |
download | cryptography-939af10558eccce22e72fafceb7eb4f32d8cea2f.tar.gz cryptography-939af10558eccce22e72fafceb7eb4f32d8cea2f.tar.bz2 cryptography-939af10558eccce22e72fafceb7eb4f32d8cea2f.zip |
Merge pull request #1755 from reaperhulk/serialize-der-ec
support DER encoded EC private key serialization
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 150dbfc0..13699558 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -1207,9 +1207,12 @@ class Backend(object): def _private_key_bytes_traditional_der(self, type, cdata): if type == self._lib.EVP_PKEY_RSA: write_bio = self._lib.i2d_RSAPrivateKey_bio + elif (self._lib.Cryptography_HAS_EC == 1 and + type == self._lib.EVP_PKEY_EC): + write_bio = self._lib.i2d_ECPrivateKey_bio else: raise TypeError( - "Only RSA keys are supported for DER serialization" + "Only RSA & EC keys are supported for DER serialization" ) bio = self._create_mem_bio() |