|
|
|
|
@ -316,8 +316,8 @@ class Crypt { |
|
|
|
|
|
|
|
|
|
throw new \InvalidArgumentException( |
|
|
|
|
sprintf( |
|
|
|
|
'Unsupported cipher (%s) defined.', |
|
|
|
|
$cipher |
|
|
|
|
'Unsupported cipher (%s) defined.', |
|
|
|
|
$cipher |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
@ -470,8 +470,7 @@ class Crypt { |
|
|
|
|
*/ |
|
|
|
|
protected function isValidPrivateKey($plainKey) { |
|
|
|
|
$res = openssl_get_privatekey($plainKey); |
|
|
|
|
// TODO: remove resource check one php7.4 is not longer supported |
|
|
|
|
if (is_resource($res) || (is_object($res) && get_class($res) === 'OpenSSLAsymmetricKey')) { |
|
|
|
|
if (is_object($res) && get_class($res) === 'OpenSSLAsymmetricKey') { |
|
|
|
|
$sslInfo = openssl_pkey_get_details($res); |
|
|
|
|
if (isset($sslInfo['key'])) { |
|
|
|
|
return true; |
|
|
|
|
|