Home > Backend Development > PHP Tutorial > php: openssl_public_encrypt()和openssl_private_encrypt()返回值总是FALSE,该如何处理

php: openssl_public_encrypt()和openssl_private_encrypt()返回值总是FALSE,该如何处理

WBOY
Release: 2016-06-13 13:37:54
Original
3837 people have browsed it

php: openssl_public_encrypt()和openssl_private_encrypt()返回值总是FALSE
--------------------php code-------------- 
$crtpath = $mailInfors['dir']['certdir'].$crtname; 
$crt = $referen->getFileContent($crtpath);
 openssl_get_publickey($crt); 
echo "crt-->>$crt
"; 
openssl_public_encrypt($_POST['sendContent'],$chrtext,$crtpath);

 -----------变量详细信息--------- 
content-->>ascas 
crtname-->>wxd.crt 
crtpath-->>/usr/nc-home/webpost/mailbox/d00/1/y/u/yushuai.niu/.user/certkey/wxd.crt

 ------------warning--------------
 Warning: openssl_public_encrypt(): key parameter is not a valid public key in ...

求解!

------解决方案--------------------
看它的提示很明显 key错了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template