-
- /**
- * @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);
- }