公司和法国一家银行做在线支付对接,对方的平台是 .net, 我这边是 php ,技术人员沟通对接的可能性比较小;
提交 form 表单时需要进行 RFC2104 规则的 HMAC 加密校验,可是我这边加密后的字符串 和对方一直对不上,不知道有没有做过 RFC2104 加密规则的大神,帮忙看下,谢谢
<?php
$str = '6321857*17/04/2017:11:39:39*62.73EUR*an2017041712*pay test*3.0*EN*ansel*[email protected]**********';
$key = '82C153B8EF860BF0386AB3F3C730ECA0C5B5EEP2';
echo hash_hmac('sha1',$str,$key);
我这边输出加密后的值为 : 7dc7b51f6a12567cf22017d7f0e3ee1dba066058
对方返回的错误是 :
The value of the seal is computed from a secret key and from the string :
6321857*17/04/2017:11:39:39*62.73EUR*an2017041712*pay test*3.0*EN*ansel*[email protected]**********
The first six and the last six characters of the expected control MAC value are :
71FC1D****************************C81CB1
我的环境为 PHP7