这句话
extension=icbc.so
重启apache后,就可以在php中直接调用这三个函数了
6.测试
程序,要将测试的证书和key文件放到php测试文件的当前目录
<?php
$realpath = dirname(__FILE__);
$key = $realpath.\"/user.key\";
$cert = $realpath.\"/user.crt\";
$src = \"zzz\";
$passwd = \"12345678\";
echo \"The Cert file information is \";
echo icbc_getCertID($cert);
echo \"<br>\";
$b64sdata = icbc_sign($src,$key,$passwd);
echo \"The string \".$src.\" encrypt by icbc api is \".$b64sdata.\"(base64 encoded)<br>\";
echo \"Now we check it weather is correct.<br>\";
if(icbc_vsign(\"zzz\",$cert,$b64sdata)){
echo \"The signtrue to \".$src.\" is right!!<br>\"; [Page]
}else{
echo \"The signtrue to \".$src.\" is wrong!!<br>\";
exit();
}
?>