From 11118efe2dcc2458d1e4b237631ede001938dc30 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Wed, 17 Jul 2024 16:27:39 -0700 Subject: [PATCH] Support phpseclib V3 --- src/Hyperwallet/Util/HyperwalletEncryption.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Hyperwallet/Util/HyperwalletEncryption.php b/src/Hyperwallet/Util/HyperwalletEncryption.php index 4602cf3..e764839 100644 --- a/src/Hyperwallet/Util/HyperwalletEncryption.php +++ b/src/Hyperwallet/Util/HyperwalletEncryption.php @@ -220,9 +220,11 @@ private function getPrivateKey($privateKeyData) { array_unshift($coefficients, "phoney"); unset($coefficients[0]); - $pemData = (new RSA())->_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients); - $privateKey = new RSA(); + $pemData = RSA::_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients); + $privateKey = RSA::loadKey($pemData); $privateKey->loadKey($pemData); + $rsa = + if ($privateKeyData['alg'] == 'RSA-OAEP-256') { $privateKey->setHash('sha256'); $privateKey->setMGFHash('sha256');