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/primitives/asymmetric | |
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/primitives/asymmetric')
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/x25519.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/x25519.py b/src/cryptography/hazmat/primitives/asymmetric/x25519.py index f4bdf3db..94602261 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/x25519.py +++ b/src/cryptography/hazmat/primitives/asymmetric/x25519.py @@ -28,7 +28,7 @@ class X25519PublicKey(object): return backend.x25519_load_public_bytes(data) @abc.abstractmethod - def public_bytes(self): + def public_bytes(self, encoding=None, format=None): """ The serialized bytes of the public key. """ @@ -47,7 +47,7 @@ class X25519PrivateKey(object): return backend.x25519_generate_key() @classmethod - def _from_private_bytes(cls, data): + def from_private_bytes(cls, data): from cryptography.hazmat.backends.openssl.backend import backend return backend.x25519_load_private_bytes(data) @@ -58,6 +58,12 @@ class X25519PrivateKey(object): """ @abc.abstractmethod + def private_bytes(self, encoding, format, encryption_algorithm): + """ + The serialized bytes of the private key. + """ + + @abc.abstractmethod def exchange(self, peer_public_key): """ Performs a key exchange operation using the provided peer's public key. |