diff options
author | bernhl <15350042+bernhl@users.noreply.github.com> | 2019-03-18 03:03:16 +0100 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-03-17 22:03:16 -0400 |
commit | a453d8709763badde325568c13961bb6745f333c (patch) | |
tree | 12c6e36e781169adcff91a1d3ced55fa94e99cda /tests/hazmat | |
parent | b73ed5a6a3067c832413a6b4c987667a9d545153 (diff) | |
download | cryptography-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.py | 11 |
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" |