diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-01-14 21:50:17 -0600 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-01-14 22:50:17 -0500 |
commit | c6c25c21496858271fbc4c89fb102074fd3d5f60 (patch) | |
tree | 009896d2b53e2d45f050b35320609bf348f0e31c /src/cryptography/hazmat/backends/openssl/backend.py | |
parent | aeb3acbe9abffba68da3cc8b6bc0f3c2acb9bd9d (diff) | |
download | cryptography-c6c25c21496858271fbc4c89fb102074fd3d5f60.tar.gz cryptography-c6c25c21496858271fbc4c89fb102074fd3d5f60.tar.bz2 cryptography-c6c25c21496858271fbc4c89fb102074fd3d5f60.zip |
Serialization x25519 (#4688)
* modify x25519 serialization to match x448
supports raw and pkcs8 encoding on private_bytes
supports raw and subjectpublickeyinfo on public_bytes
deprecates zero argument call to public_bytes
* add docs
* this is public now
* don't need that
* review feedback
Diffstat (limited to 'src/cryptography/hazmat/backends/openssl/backend.py')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index ecebe7b8..9eca5f8a 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -511,6 +511,9 @@ class Backend(object): elif key_type == getattr(self._lib, "EVP_PKEY_X448", None): # EVP_PKEY_X448 is not present in OpenSSL < 1.1.1 return _X448PrivateKey(self, evp_pkey) + elif key_type == getattr(self._lib, "EVP_PKEY_X25519", None): + # EVP_PKEY_X25519 is not present in OpenSSL < 1.1.0 + return _X25519PrivateKey(self, evp_pkey) else: raise UnsupportedAlgorithm("Unsupported key type.") @@ -545,6 +548,9 @@ class Backend(object): elif key_type == getattr(self._lib, "EVP_PKEY_X448", None): # EVP_PKEY_X448 is not present in OpenSSL < 1.1.1 return _X448PublicKey(self, evp_pkey) + elif key_type == getattr(self._lib, "EVP_PKEY_X25519", None): + # EVP_PKEY_X25519 is not present in OpenSSL < 1.1.0 + return _X25519PublicKey(self, evp_pkey) else: raise UnsupportedAlgorithm("Unsupported key type.") |