Recently I am working on the bank’s QR code payment access. After getting the document, there are a few things I don’t understand very well.
1. Downloaded the private key (.sm2) and public key (.cer) of the signed certificate and imported the public key directly. I don’t know how to use the private key certificate
2. Since I am using the PHP demo, PHP The code calls LAJP to call the JAVA environment for signing. The data obtained after signing in the php demo cannot pass the test signature verification. I don’t know which step is wrong
Attached is the test demo on the web page: http://wxpay.cmbc.com.cn/cmbc...< br>Provided local signature function:
<?php
require_once("php_java.php");//Quoting the PHP script provided by LAJP
try
{
$signAlg = $_REQUEST['signAlg'];
$base64SourceData = $_REQUEST['base64SourceData'];
$base64P12Data = $_REQUEST['base64P12Data'];
$p12Password = $_REQUEST['p12Password'];
$ret = lajp_call("cfca.sadk.api.SignatureKit::P1SignMessage", $signAlg,$base64SourceData, $base64P12Data,$p12Password);
echo "{$ret}<br>";
}
catch(Exception $e)
{
echo "Err:{$e}<br>";
}
?><a href="index.html">return</a>