用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
本扩展使用[» OpenSSL](http://www.openssl.org/)库来对称/非对称加解密,以及 PBKDF2、 PKCS7、 PKCS12、 X509 和其他加密操作。除此之外还提供了 TLS 流的实现。 OpenSSL 还提供了更多本模块暂不支持的功能,某些功能以后可能会增加。 手动开启: 要使用 PHP 的 OpenSSL 支持,你应该使用**\--with-openssl\[=DIR\]**参数来编译PHP. * [预定义常量](https://www.php.net/manual/zh/openssl.constants.php) * [目的检查标志](https://www.php.net/manual/zh/openssl.purpose-check.php) * [非对称加密的填充标志](https://www.php.net/manual/zh/openssl.padding.php) * [密钥类型](https://www.php.net/manual/zh/openssl.key-types.php) * [PKCS7 标志/常量](https://www.php.net/manual/zh/openssl.pkcs7.flags.php) * [Signature Algorithms](https://www.php.net/manual/zh/openssl.signature-algos.php) * [Ciphers](https://www.php.net/manual/zh/openssl.ciphers.php) * [Version constants](https://www.php.net/manual/zh/openssl.constversion.php) * [Server Name Indication constants](https://www.php.net/manual/zh/openssl.constsni.php) * [密钥/证书参数](https://www.php.net/manual/zh/openssl.certparams.php) * [证书验证](https://www.php.net/manual/zh/openssl.cert.verification.php) * [OpenSSL 函数](https://www.php.net/manual/zh/ref.openssl.php) * [openssl\_cipher\_iv\_length](https://www.php.net/manual/zh/function.openssl-cipher-iv-length.php)— 获取密码iv长度 * [openssl\_csr\_export\_to\_file](https://www.php.net/manual/zh/function.openssl-csr-export-to-file.php)— 将CSR导出到文件 * [openssl\_csr\_export](https://www.php.net/manual/zh/function.openssl-csr-export.php)— 将CSR作为字符串导出 * [openssl\_csr\_get\_public\_key](https://www.php.net/manual/zh/function.openssl-csr-get-public-key.php)— 返回CSR的公钥 * [openssl\_csr\_get\_subject](https://www.php.net/manual/zh/function.openssl-csr-get-subject.php)— 返回CSR的主题 * [openssl\_csr\_new](https://www.php.net/manual/zh/function.openssl-csr-new.php)— 生成一个 CSR * [openssl\_csr\_sign](https://www.php.net/manual/zh/function.openssl-csr-sign.php)— 用另一个证书签署 CSR (或者本身) 并且生成一个证书 * [openssl\_decrypt](https://www.php.net/manual/zh/function.openssl-decrypt.php)— 解密数据 * [openssl\_dh\_compute\_key](https://www.php.net/manual/zh/function.openssl-dh-compute-key.php)— 计算远程DH密钥(公钥)和本地DH密钥的共享密钥 * [openssl\_digest](https://www.php.net/manual/zh/function.openssl-digest.php)— 计算摘要 * [openssl\_encrypt](https://www.php.net/manual/zh/function.openssl-encrypt.php)— 加密数据 * [openssl\_error\_string](https://www.php.net/manual/zh/function.openssl-error-string.php)— 返回 openSSL 错误消息 * [openssl\_free\_key](https://www.php.net/manual/zh/function.openssl-free-key.php)— 释放密钥资源 * [openssl\_get\_cert\_locations](https://www.php.net/manual/zh/function.openssl-get-cert-locations.php)— 检索可用的证书位置 * [openssl\_get\_cipher\_methods](https://www.php.net/manual/zh/function.openssl-get-cipher-methods.php)— 获取可用的加密算法 * [openssl\_get\_curve\_names](https://www.php.net/manual/zh/function.openssl-get-curve-names.php)— 获得ECC的可用曲线名称列表 * [openssl\_get\_md\_methods](https://www.php.net/manual/zh/function.openssl-get-md-methods.php)— 获取可用的摘要算法 * [openssl\_get\_privatekey](https://www.php.net/manual/zh/function.openssl-get-privatekey.php)— 别名 openssl\_pkey\_get\_private * [openssl\_get\_publickey](https://www.php.net/manual/zh/function.openssl-get-publickey.php)— 别名 openssl\_pkey\_get\_public * [openssl\_open](https://www.php.net/manual/zh/function.openssl-open.php)— 打开密封的数据 * [openssl\_pbkdf2](https://www.php.net/manual/zh/function.openssl-pbkdf2.php)— 生成一个 PKCS5 v2 PBKDF2 字符串 * [openssl\_pkcs12\_export\_to\_file](https://www.php.net/manual/zh/function.openssl-pkcs12-export-to-file.php)— 输出一个 PKCS#12 兼容的证书存储文件 * [openssl\_pkcs12\_export](https://www.php.net/manual/zh/function.openssl-pkcs12-export.php)— 将 PKCS#12 兼容证书存储文件导出到变量 * [openssl\_pkcs12\_read](https://www.php.net/manual/zh/function.openssl-pkcs12-read.php)— 将 PKCS#12 证书存储区解析到数组中 * [openssl\_pkcs7\_decrypt](https://www.php.net/manual/zh/function.openssl-pkcs7-decrypt.php)— 解密一个 S/MIME 加密的消息 * [openssl\_pkcs7\_encrypt](https://www.php.net/manual/zh/function.openssl-pkcs7-encrypt.php)— 加密一个 S/MIME 消息 * [openssl\_pkcs7\_read](https://www.php.net/manual/zh/function.openssl-pkcs7-read.php)— 将PKCS7文件导出为PEM格式证书的数组 * [openssl\_pkcs7\_sign](https://www.php.net/manual/zh/function.openssl-pkcs7-sign.php)— 对一个 S/MIME 消息进行签名 * [openssl\_pkcs7\_verify](https://www.php.net/manual/zh/function.openssl-pkcs7-verify.php)— 校验一个已签名的 S/MIME 消息的签名 * [openssl\_pkey\_export\_to\_file](https://www.php.net/manual/zh/function.openssl-pkey-export-to-file.php)— 将密钥导出到文件中 * [openssl\_pkey\_export](https://www.php.net/manual/zh/function.openssl-pkey-export.php)— 将一个密钥的可输出表示转换为字符串 * [openssl\_pkey\_free](https://www.php.net/manual/zh/function.openssl-pkey-free.php)— 释放一个私钥 * [openssl\_pkey\_get\_details](https://www.php.net/manual/zh/function.openssl-pkey-get-details.php)— 返回包含密钥详情的数组 * [openssl\_pkey\_get\_private](https://www.php.net/manual/zh/function.openssl-pkey-get-private.php)— 获取私钥 * [openssl\_pkey\_get\_public](https://www.php.net/manual/zh/function.openssl-pkey-get-public.php)— 从证书中解析公钥,以供使用。 * [openssl\_pkey\_new](https://www.php.net/manual/zh/function.openssl-pkey-new.php)— 生成一个新的私钥 * [openssl\_private\_decrypt](https://www.php.net/manual/zh/function.openssl-private-decrypt.php)— 使用私钥解密数据 * [openssl\_private\_encrypt](https://www.php.net/manual/zh/function.openssl-private-encrypt.php)— 使用私钥加密数据 * [openssl\_public\_decrypt](https://www.php.net/manual/zh/function.openssl-public-decrypt.php)— 使用公钥解密数据 * [openssl\_public\_encrypt](https://www.php.net/manual/zh/function.openssl-public-encrypt.php)— 使用公钥加密数据 * [openssl\_random\_pseudo\_bytes](https://www.php.net/manual/zh/function.openssl-random-pseudo-bytes.php)— 生成一个伪随机字节串 * [openssl\_seal](https://www.php.net/manual/zh/function.openssl-seal.php)— 密封 (加密) 数据 * [openssl\_sign](https://www.php.net/manual/zh/function.openssl-sign.php)— Generate signature * [openssl\_spki\_export\_challenge](https://www.php.net/manual/zh/function.openssl-spki-export-challenge.php)— 导出与签名公钥和挑战相关的挑战字符串 * [openssl\_spki\_export](https://www.php.net/manual/zh/function.openssl-spki-export.php)— 通过签名公钥和挑战导出一个可用的PEM格式的公钥 * [openssl\_spki\_new](https://www.php.net/manual/zh/function.openssl-spki-new.php)— 生成一个新的签名公钥和挑战 * [openssl\_spki\_verify](https://www.php.net/manual/zh/function.openssl-spki-verify.php)— 验证签名公钥和挑战。 * [openssl\_verify](https://www.php.net/manual/zh/function.openssl-verify.php)— 验证签名 * [openssl\_x509\_check\_private\_key](https://www.php.net/manual/zh/function.openssl-x509-check-private-key.php)— 检查私钥是否对应于证书 * [openssl\_x509\_checkpurpose](https://www.php.net/manual/zh/function.openssl-x509-checkpurpose.php)— 验证是否可以为特定目的使用证书 * [openssl\_x509\_export\_to\_file](https://www.php.net/manual/zh/function.openssl-x509-export-to-file.php)— 导出证书至文件 * [openssl\_x509\_export](https://www.php.net/manual/zh/function.openssl-x509-export.php)— 以字符串格式导出证书 * [openssl\_x509\_fingerprint](https://www.php.net/manual/zh/function.openssl-x509-fingerprint.php)— 计算一个给定的x.509证书的指纹或摘要 * [openssl\_x509\_free](https://www.php.net/manual/zh/function.openssl-x509-free.php)— 释放证书资源 * [openssl\_x509\_parse](https://www.php.net/manual/zh/function.openssl-x509-parse.php)— 解析一个X509证书并作为一个数组返回信息 * [openssl\_x509\_read](https://www.php.net/manual/zh/function.openssl-x509-read.php)— 解析一个x.509证书并返回一个资源标识符 * [openssl\_x509\_verify](https://www.php.net/manual/zh/function.openssl-x509-verify.php)— Verifies digital signature of x509 certificate against a public key