我在
openssl_verify()上看过帖子
我想问一些与openssl_verify()有关的问题.
因为我的PHP代码无法验证从Java创建的签名…
对于服务器端,这是我的PHP代码
$data =$_POST['data'];
$signature=$_POST['sig'];
$pub_key=$_POST['pubkey'];
function print_input()
{
global $data;
global $signature;
global $pub_key;
// I output the public key to file, and check it to make sure they
// are in correct pem format.
///
$f=fopen("./Personnel_Pubkey/pubkey.pem", "w");
fwrite($f,"$pub_key");
fclose($f);
$key = openssl_pkey_get_public ("./Personnel_Pubkey/pubkey.pem");
// doesn't work if you use PEM format public key, only works with X.509 format
// certificate, and cert and private key in PEM format.
$result=openssl_public_decrypt (