[Composer] Upgrade to phpseclib version 3
- Create custom Key file format for Salmon Magic key - Remove obsolete pemToME and MEtoPem Crypto methods - Remove unused newECKeypair Crypto method - Switch to constant-time Base64 encode/decode in Base64Url Strings methods
This commit is contained in:
parent
a3fb499735
commit
55640eec87
13 changed files with 241 additions and 173 deletions
|
@ -65,7 +65,7 @@ class CryptoTest extends TestCase
|
|||
self::assertEquals(11111111, $test);
|
||||
}
|
||||
|
||||
public function dataRsa()
|
||||
public function dataRsa(): array
|
||||
{
|
||||
return [
|
||||
'diaspora' => [
|
||||
|
@ -92,34 +92,6 @@ class CryptoTest extends TestCase
|
|||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataPEM
|
||||
*/
|
||||
public function testPemToMe(string $key)
|
||||
{
|
||||
Crypto::pemToMe($key, $m, $e);
|
||||
|
||||
$expectedRSA = new RSA();
|
||||
$expectedRSA->loadKey([
|
||||
'e' => new BigInteger($e, 256),
|
||||
'n' => new BigInteger($m, 256)
|
||||
]);
|
||||
|
||||
self::assertEquals($expectedRSA->getPublicKey(), $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataPEM
|
||||
*/
|
||||
public function testMeToPem(string $key)
|
||||
{
|
||||
Crypto::pemToMe($key, $m, $e);
|
||||
|
||||
$checkKey = Crypto::meToPem($m, $e);
|
||||
|
||||
self::assertEquals($key, $checkKey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue