File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 61
61
use phpseclib3 \Exception \NoKeyLoadedException ;
62
62
use phpseclib3 \Crypt \Common \Formats \Keys \PuTTY ;
63
63
use phpseclib3 \Crypt \Common \Formats \Keys \OpenSSH ;
64
+ use phpseclib3 \Math \BigInteger ;
65
+ use phpseclib \Math \BigInteger as BigInteger2 ;
64
66
65
67
/**
66
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 {
387
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
+ }
388
397
$ this ->key = PublicKeyLoader::load ($ key , $ this ->password );
389
398
} catch (NoKeyLoadedException $ e ) {
390
399
$ this ->key = $ this ->origKey = null ;
You can’t perform that action at this time.
0 commit comments