This commit is contained in:
xl
2024-06-03 10:53:51 +08:00
parent aeb4f3d7fb
commit d76680a7a2
+1 -1
View File
@@ -111,7 +111,7 @@ class WxV3PaymentNotify extends SmallProgram
*/ */
protected function rsaFrom(string $thing, string $type = KEY_TYPE_PRIVATE): OpenSSLAsymmetricKey protected function rsaFrom(string $thing, string $type = KEY_TYPE_PRIVATE): OpenSSLAsymmetricKey
{ {
$pkey = (($isPublic = $type === KEY_TYPE_PUBLIC) ? openssl_pkey_get_public(file_get_contents($thing)) : openssl_pkey_get_private(file_get_contents($thing))); $pkey = (($isPublic = $type === KEY_TYPE_PUBLIC) ? openssl_pkey_get_public('file:/' . $thing) : openssl_pkey_get_private('file:/' . $thing));
if (false === $pkey) { if (false === $pkey) {
throw new \UnexpectedValueException(sprintf('Cannot load %s from(%s), please take care about the $thing input.', $isPublic ? 'publicKey' : 'privateKey', gettype($thing))); throw new \UnexpectedValueException(sprintf('Cannot load %s from(%s), please take care about the $thing input.', $isPublic ? 'publicKey' : 'privateKey', gettype($thing)));
} }