Home > php教程 > php手册 > php环境下配置openssl实现签名验证

php环境下配置openssl实现签名验证

WBOY
Release: 2016-06-21 09:05:12
Original
1172 people have browsed it

配置如下

1:编辑openssl,php5需要0.96以上版本

2:将编译好的libeay32.dll,ssleay32.dll放到system32目录下

3:将php.ini中的openssl.dll前面的;去掉

4:将php目录下的php_openssl.dll拷贝到system32目录下

5:设置环境变量

OPENSSL_CONF=c:opensslopenssl.cnf

其中php自带了一个cnf示例,在phpextrasopenssl目录下

编写测试代码:

$config = array(
"digest_alg" => "sha1",
"private_key_bits" => 1024,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
"encrypt_key" => false
);

$privkey = openssl_pkey_new($config);
openssl_pkey_export($privkey, $keydata);
echo $keydata;

其它函数参见php的openssl帮助



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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template