Merge branch '3.0'

This commit is contained in:
terrafrost 2020-12-23 07:49:30 -06:00
commit f77930aa83
2 changed files with 12 additions and 1 deletions

View File

@ -33,7 +33,7 @@ abstract class PublicKeyLoader
*
* @return AsymmetricKey
* @access public
* @param string $key
* @param string|array $key
* @param string $password optional
*/
public static function load($key, $password = false)

View File

@ -34,6 +34,17 @@ class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase
PublicKeyLoader::load($key);
}
public function testLoadModulusAndExponent()
{
$rsa = PublicKeyLoader::load([
'e' => new BigInteger('123', 16),
'n' => new BigInteger('123', 16)
]);
$this->assertInstanceOf(PublicKey::class, $rsa);
$this->assertIsString("$rsa");
}
public function testPKCS1Key()
{
$key = '-----BEGIN RSA PRIVATE KEY-----