We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8d3f14 commit 598f003Copy full SHA for 598f003
src/Crypt/RSA.php
@@ -61,6 +61,8 @@
61
use phpseclib3\Exception\NoKeyLoadedException;
62
use phpseclib3\Crypt\Common\Formats\Keys\PuTTY;
63
use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH;
64
+use phpseclib3\Math\BigInteger;
65
+use phpseclib\Math\BigInteger as BigInteger2;
66
67
/**
68
* Pure-PHP PKCS#1 compliant implementation of RSA.
@@ -385,6 +387,13 @@ public function loadKey($key)
385
387
$this->key = $key->key;
386
388
} else {
389
try {
390
+ if (is_array($key)) {
391
+ foreach ($key as &$value) {
392
+ if ($value instanceof BigInteger2) {
393
+ $value = new BigInteger($value->toBytes(true), -256);
394
+ }
395
396
397
$this->key = PublicKeyLoader::load($key, $this->password);
398
} catch (NoKeyLoadedException $e) {
399
$this->key = $this->origKey = null;
0 commit comments