|
@@ -34,7 +34,12 @@ function rsaSign($data, $private_key_path) {
|
|
|
*/
|
|
|
function rsaVerify($data, $ali_public_key_path, $sign) {
|
|
|
$pubKey = file_get_contents($ali_public_key_path);
|
|
|
- $res = openssl_get_publickey($pubKey);
|
|
|
+
|
|
|
+ try{
|
|
|
+ $res = openssl_get_publickey($pubKey);
|
|
|
+ } catch(Exception $e){
|
|
|
+ $msg = $e->getMessage();
|
|
|
+ }
|
|
|
$result = (bool)openssl_verify($data, base64_decode($sign), $res);
|
|
|
openssl_free_key($res);
|
|
|
return $result;
|