rsa 验签
//校验 sha1WithRSA 签名 public function verifySign($data, $sign, $pubKey){ $sign = base64_decode($sign); $pubKey = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($pubKey, 64, "\n", true) . "\n-----END PUBLIC KEY-----"; $key = openssl_pkey_get_public($pubKey); $result = openssl_verify($data, $sign, $key, OPENSSL_ALGO_SHA1) === 1; return $result; }