auth->getSigningKey(); $signedString = ''; if (\class_exists('WPMailSMTP\\Vendor\\phpseclib\\Crypt\\RSA') && !$forceOpenssl) { $rsa = new \WPMailSMTP\Vendor\phpseclib\Crypt\RSA(); $rsa->loadKey($privateKey); $rsa->setSignatureMode(\WPMailSMTP\Vendor\phpseclib\Crypt\RSA::SIGNATURE_PKCS1); $rsa->setHash('sha256'); $signedString = $rsa->sign($stringToSign); } elseif (\extension_loaded('openssl')) { \openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption'); } else { // @codeCoverageIgnoreStart throw new \RuntimeException('OpenSSL is not installed.'); } // @codeCoverageIgnoreEnd return \base64_encode($signedString); } }