<?php
openssl_sign ( string $data , string &$signature , OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key , string|int $algorithm = OPENSSL_ALGO_SHA1 ) : bool
?>
openssl_sign() computes a signature for the specified data by generating a cryptographic digital signature using the private key associated withprivate_key. Note that the data itself is not encrypted.
$raw_sign 是 openssl_sign()函数的返回值是吧,
$mch_private_key 是你的商户私钥内容,可以通过 file_get_contents获取
我试着输出内容看到是这样的
print输出内容:Resource id #3
var_dump输出内容:resource(4) of type (OpenSSL key)
代你查了下文档 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_0.shtml :
<?php openssl_sign ( string $data , string &$signature , OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key , string|int $algorithm = OPENSSL_ALGO_SHA1 ) : bool ?> openssl_sign() computes a signature for the specified data by generating a cryptographic digital signature using the private key associated withprivate_key. Note that the data itself is not encrypted.
$raw_sign 等于是个变量指针,用于存储数据签名后的值,$mch_private_key 是你的商户私钥内容,可以通过 file_get_contents获取
$raw_sign 是 openssl_sign()函数的返回值是吧, $mch_private_key 是你的商户私钥内容,可以通过 file_get_contents获取 我试着输出内容看到是这样的 print输出内容:Resource id #3 var_dump输出内容:resource(4) of type (OpenSSL key)