摘要:经常做银行的支付接口,私钥一般都是pfx格式(私钥用来加密生成签名发送报文),公钥是cer格式(公钥用来验证返回报文里的签名)。但是php里openssl只能用pem格式,每次转换都要用openssl命令在本地转好,很是麻烦。下面是直接php转换的代码。私钥pfx转pem//filePath为pfx文件路径function signfrompfx($strData,$filePath,$keyPass) { if(!file_exists($filePath)) { return false; } $pkcs1...
阅读全文
posted @ 2014-03-16 11:56