diff --git a/tests/Unit/Crypt/EC/KeyTest.php b/tests/Unit/Crypt/EC/KeyTest.php index 0b10bf8d..43928d78 100644 --- a/tests/Unit/Crypt/EC/KeyTest.php +++ b/tests/Unit/Crypt/EC/KeyTest.php @@ -15,6 +15,7 @@ use phpseclib3\Crypt\EC\Formats\Keys\PKCS8; use phpseclib3\Crypt\EC\Formats\Keys\PuTTY; use phpseclib3\Crypt\EC\Formats\Keys\XML; use phpseclib3\Crypt\EC\PrivateKey; +use phpseclib3\Crypt\EC\PublicKey; use phpseclib3\Crypt\PublicKeyLoader; use phpseclib3\Tests\PhpseclibTestCase; @@ -670,4 +671,11 @@ MIIEDwIBADATBgcqhkjOPQIBBggqhkjOPQMBBwSCA/MwggPvAgEBBIID6P////// $this->assertTrue($key->verify($plaintext, $sig)); } + + public function testNakedPKCS8PubKey() + { + $key = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErPJyxEu2/oKCrJaaTVTrq39DKJ2XcN6W+k8UvGf+Y/lDWNbFitQocabsDUvSN0edHH3UKP5QPTz4cOlyIPMrXQ=='; + $key = PublicKeyLoader::load($key); + $this->assertInstanceOf(PublicKey::class, $key); + } }