mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-18 03:05:11 +00:00
Tests/EC: add unit test for naked PKCS8 public key
This commit is contained in:
parent
71b9b64203
commit
b9996fda00
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user