求大神解答,万分感谢
PHP 源码:
$xmldata = '<?xml version="1.0" encoding="GBK"?>
310001
05
2
5
200604000012282
20060400001228204
111111
200604000012282-1526894131128
200604000012282
0104
00
62284811119386045775
小虎
0
0
320382111111086514
187621116887
单笔实时身份验证-备注字段
';
openssl_pkcs12_read(file_get_contents('3.p12'), $certs, '111111');
$signature = '';
openssl_sign($xmldata, $signature, $certs['pkey']);
$sign = bin2hex($signature);
java 源码:
Signature sign = Signature.getInstance("SHA1withRSA");
sign.initSign(prikey);
sign.update(msg.getBytes(encoding));
byte signed[] = sign.sign();
byte sign_asc[] = new byte[signed.length * 2];
Hex2Ascii(signed.length, signed, sign_asc);
signedStr = new String(sign_asc);