From fd8389f365dfde77d9f1b71399c0e615a83030ba Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 17 Dec 2019 07:55:36 -0600 Subject: [PATCH] add unit test for phpseclib created PKCS8 Ed25519 private keys --- tests/Unit/Crypt/EC/KeyTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Unit/Crypt/EC/KeyTest.php b/tests/Unit/Crypt/EC/KeyTest.php index fc71ae9e..21d0eb3a 100644 --- a/tests/Unit/Crypt/EC/KeyTest.php +++ b/tests/Unit/Crypt/EC/KeyTest.php @@ -262,6 +262,11 @@ MFICAQEwBwYDK2VwBQAEIgQg1O5y2/kTWErVttjx92n4rTr+fCjL8dT74Jeoj0R1 WEKBIBm/RAlphM3+hUG6wWfcO5bIUIaqMLa2ywxcOK1wMWbh -----END PRIVATE KEY-----'; $this->assertSame($expected, $key->toString('PKCS8')); + + $expected = EC::createKey('Ed25519')->toString('PKCS8'); + $key = PublicKeyLoader::load($expected); + $this->assertSame('Ed25519', $key->getCurve()); + $this->assertSame('Ed25519', $key->getPublicKey()->getCurve()); } public function testPuTTYnistp256()