aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorbernhl <15350042+bernhl@users.noreply.github.com>2019-03-18 03:03:16 +0100
committerAlex Gaynor <alex.gaynor@gmail.com>2019-03-17 22:03:16 -0400
commita453d8709763badde325568c13961bb6745f333c (patch)
tree12c6e36e781169adcff91a1d3ced55fa94e99cda /tests/hazmat
parentb73ed5a6a3067c832413a6b4c987667a9d545153 (diff)
downloadcryptography-a453d8709763badde325568c13961bb6745f333c.tar.gz
cryptography-a453d8709763badde325568c13961bb6745f333c.tar.bz2
cryptography-a453d8709763badde325568c13961bb6745f333c.zip
add OpenSSH serialization for ed25519 keys (#4808) (#4811)
* add OpenSSH serialization for ed25519 keys (#4808) * address review comments
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/test_serialization.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index c5ce258c..f7d186e8 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -1293,6 +1293,17 @@ class TestEd25519SSHSerialization(object):
b"N\x06G\xecV\xbc\x19\xaf\xc6<k\x07[\xc6"
)
+ def test_public_bytes_openssh(self, backend):
+ ssh_key = (
+ b"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG2fgpmpYO61qeAxGd0wgRaN/E4"
+ b"GR+xWvBmvxjxrB1vG"
+ )
+ key = load_ssh_public_key(ssh_key, backend)
+ assert isinstance(key, ed25519.Ed25519PublicKey)
+ assert key.public_bytes(
+ Encoding.OpenSSH, PublicFormat.OpenSSH
+ ) == ssh_key
+
def test_load_ssh_public_key_not_32_bytes(self, backend):
ssh_key = (
b"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI22fgpmpYO61qeAxGd0wgRaN/E4"