mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-04 02:28:06 +01:00
Show array-failure in load() method
This commit is contained in:
parent
02fa3b142e
commit
224abbc1f9
@ -33,7 +33,7 @@ abstract class PublicKeyLoader
|
|||||||
*
|
*
|
||||||
* @return AsymmetricKey
|
* @return AsymmetricKey
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $key
|
* @param string|array $key
|
||||||
* @param string $password optional
|
* @param string $password optional
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = false)
|
public static function load($key, $password = false)
|
||||||
|
@ -34,6 +34,17 @@ class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase
|
|||||||
PublicKeyLoader::load($key);
|
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()
|
public function testPKCS1Key()
|
||||||
{
|
{
|
||||||
$key = '-----BEGIN RSA PRIVATE KEY-----
|
$key = '-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
Loading…
Reference in New Issue
Block a user