签名校验 - php怎样进行SHA512withRSA算法签名?
怪我咯
怪我咯 2017-05-16 13:05:17
0
1
1001

找了一下只找到[SHA1withRSA][1]算法签名,没找到SHA512withRSA

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
曾经蜡笔没有小新
function sign($data) {
    $certs = array();
    openssl_pkcs12_read(file_get_contents("你的.pfx文件路径"), $certs, "password"); //其中password为你的证书密码
    if(!$certs) return ;
    $signature = '';  
    openssl_sign($data, $signature, $certs['pkey'],OPENSSL_ALGO_SHA512);
    return base64_encode($signature); 
}
e

OopensSL_Sign 默认 Signature_alg 参数 是 OpenSSL_Algo_Sha1
Signature_alg 其他 参数

OpenSL_Algo_DSS1 (Integer)
OpenSL_SHA1 (Integer) )
openssl_algo_sha384 (Integer)
opensl_algo_sha512 (Integer)
opensl_algo_rmd160 (integer)
openssl_algo_md5 (integer )
  OPENSSL_ALGO_MD4 (integer)
  OPENSSL_ALGO_MD2 (integer)
参考:http://php.net/manual/en/func...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!