<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.crypto.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'book.openssl.php',
    1 => 'OpenSSL',
    2 => 'OpenSSL',
  ),
  'up' => 
  array (
    0 => 'refs.crypto.php',
    1 => '加密扩展',
  ),
  'prev' => 
  array (
    0 => 'function.mhash-keygen-s2k.php',
    1 => 'mhash_keygen_s2k',
  ),
  'next' => 
  array (
    0 => 'openssl.setup.php',
    1 => '安装/配置',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/openssl/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.openssl.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.openssl" class="book">
 
 <h1 class="title">OpenSSL</h1>
 
 
 <div id="intro.openssl" class="preface">
  <h1 class="title">简介</h1>
  <p class="para">
   本扩展使用 <a href="http://www.openssl.org/" class="link external">&raquo;&nbsp;OpenSSL</a> 库来对称/非对称加解密，以及 PBKDF2、 PKCS7、 PKCS12、 X509  和其他加密操作。除此之外还提供了 TLS 流的实现。
  </p>
  <p class="para">
   OpenSSL 还提供了更多本模块暂不支持的功能，某些功能以后可能会增加。
  </p>
 </div>
 
 
 








 






 








 




 




 









 




 

 




 

 




 


<ul class="chunklist chunklist_book"><li><a href="openssl.setup.php">安装/配置</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="openssl.requirements.php">需求</a></li><li><a href="openssl.installation.php">安装</a></li><li><a href="openssl.configuration.php">运行时配置</a></li><li><a href="openssl.resources.php">资源类型</a></li></ul></li><li><a href="openssl.constants.php">预定义常量</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="openssl.purpose-check.php">目的检查 flag</a></li><li><a href="openssl.padding.php">非对称加密的填充标志</a></li><li><a href="openssl.key-types.php">密钥类型</a></li><li><a href="openssl.pkcs7.flags.php">PKCS7 flag/常量</a></li><li><a href="openssl.cms.flags.php">CMS Flag/常量</a></li><li><a href="openssl.signature-algos.php">签名算法</a></li><li><a href="openssl.ciphers.php">Ciphers</a></li><li><a href="openssl.constversion.php">版本常量</a></li><li><a href="openssl.constsni.php">Server Name Indication constants</a></li><li><a href="openssl.constants.other.php">其它常量</a></li></ul></li><li><a href="openssl.certparams.php">密钥/证书参数</a></li><li><a href="openssl.cert.verification.php">证书验证</a></li><li><a href="ref.openssl.php">OpenSSL 函数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.openssl-cipher-iv-length.php">openssl_cipher_iv_length</a> — 获取密码iv长度</li><li><a href="function.openssl-cipher-key-length.php">openssl_cipher_key_length</a> — Gets the cipher key length</li><li><a href="function.openssl-cms-decrypt.php">openssl_cms_decrypt</a> — Decrypt a CMS message</li><li><a href="function.openssl-cms-encrypt.php">openssl_cms_encrypt</a> — Encrypt a CMS message</li><li><a href="function.openssl-cms-read.php">openssl_cms_read</a> — Export the CMS file to an array of PEM certificates</li><li><a href="function.openssl-cms-sign.php">openssl_cms_sign</a> — Sign a file</li><li><a href="function.openssl-cms-verify.php">openssl_cms_verify</a> — Verify a CMS signature</li><li><a href="function.openssl-csr-export.php">openssl_csr_export</a> — 将 CSR 作为字符串导出</li><li><a href="function.openssl-csr-export-to-file.php">openssl_csr_export_to_file</a> — 将 CSR 导出到文件</li><li><a href="function.openssl-csr-get-public-key.php">openssl_csr_get_public_key</a> — 返回 CSR 的公钥</li><li><a href="function.openssl-csr-get-subject.php">openssl_csr_get_subject</a> — 返回 CSR 的主题</li><li><a href="function.openssl-csr-new.php">openssl_csr_new</a> — 生成一个 CSR</li><li><a href="function.openssl-csr-sign.php">openssl_csr_sign</a> — 用另一个证书签署 CSR（或者本身）并且生成一个证书</li><li><a href="function.openssl-decrypt.php">openssl_decrypt</a> — 解密数据</li><li><a href="function.openssl-dh-compute-key.php">openssl_dh_compute_key</a> — 计算远程 DH 公钥和本地 DH 密钥的共享密钥</li><li><a href="function.openssl-digest.php">openssl_digest</a> — 计算摘要</li><li><a href="function.openssl-encrypt.php">openssl_encrypt</a> — 加密数据</li><li><a href="function.openssl-error-string.php">openssl_error_string</a> — 返回 openSSL 错误消息</li><li><a href="function.openssl-free-key.php">openssl_free_key</a> — 释放密钥资源</li><li><a href="function.openssl-get-cert-locations.php">openssl_get_cert_locations</a> — 检索可用的证书位置</li><li><a href="function.openssl-get-cipher-methods.php">openssl_get_cipher_methods</a> — 获取可用的加密算法</li><li><a href="function.openssl-get-curve-names.php">openssl_get_curve_names</a> — 获得ECC的可用曲线名称列表</li><li><a href="function.openssl-get-md-methods.php">openssl_get_md_methods</a> — 获取可用的摘要算法</li><li><a href="function.openssl-get-privatekey.php">openssl_get_privatekey</a> — 别名 openssl_pkey_get_private</li><li><a href="function.openssl-get-publickey.php">openssl_get_publickey</a> — 别名 openssl_pkey_get_public</li><li><a href="function.openssl-open.php">openssl_open</a> — 打开密封的数据</li><li><a href="function.openssl-password-hash.php">openssl_password_hash</a> — Create a password hash using OpenSSL's Argon2 implementation</li><li><a href="function.openssl-password-verify.php">openssl_password_verify</a> — Verify a password against a hash using OpenSSL's Argon2 implementation</li><li><a href="function.openssl-pbkdf2.php">openssl_pbkdf2</a> — 生成 PKCS5 v2 PBKDF2 字符串</li><li><a href="function.openssl-pkcs12-export.php">openssl_pkcs12_export</a> — 将 PKCS#12 兼容证书存储文件导出到变量</li><li><a href="function.openssl-pkcs12-export-to-file.php">openssl_pkcs12_export_to_file</a> — 输出一个 PKCS#12 兼容的证书存储文件</li><li><a href="function.openssl-pkcs12-read.php">openssl_pkcs12_read</a> — 将 PKCS#12 证书存储区解析到数组中</li><li><a href="function.openssl-pkcs7-decrypt.php">openssl_pkcs7_decrypt</a> — 解密一个 S/MIME 加密的消息</li><li><a href="function.openssl-pkcs7-encrypt.php">openssl_pkcs7_encrypt</a> — 加密一个 S/MIME 消息</li><li><a href="function.openssl-pkcs7-read.php">openssl_pkcs7_read</a> — 将 PKCS7 文件导出为 PEM 格式证书的数组</li><li><a href="function.openssl-pkcs7-sign.php">openssl_pkcs7_sign</a> — 对一个 S/MIME 消息进行签名</li><li><a href="function.openssl-pkcs7-verify.php">openssl_pkcs7_verify</a> — 校验一个已签名的 S/MIME 消息的签名</li><li><a href="function.openssl-pkey-derive.php">openssl_pkey_derive</a> — Computes shared secret for public value of remote and local DH or ECDH key</li><li><a href="function.openssl-pkey-export.php">openssl_pkey_export</a> — 将一个密钥的可输出表示转换为字符串</li><li><a href="function.openssl-pkey-export-to-file.php">openssl_pkey_export_to_file</a> — 将密钥导出到文件中</li><li><a href="function.openssl-pkey-free.php">openssl_pkey_free</a> — 释放一个私钥</li><li><a href="function.openssl-pkey-get-details.php">openssl_pkey_get_details</a> — 返回包含密钥详情的数组</li><li><a href="function.openssl-pkey-get-private.php">openssl_pkey_get_private</a> — 获取私钥</li><li><a href="function.openssl-pkey-get-public.php">openssl_pkey_get_public</a> — 从证书中解析公钥，以供使用</li><li><a href="function.openssl-pkey-new.php">openssl_pkey_new</a> — 生成新的私钥</li><li><a href="function.openssl-private-decrypt.php">openssl_private_decrypt</a> — 使用私钥解密数据</li><li><a href="function.openssl-private-encrypt.php">openssl_private_encrypt</a> — 使用私钥加密数据</li><li><a href="function.openssl-public-decrypt.php">openssl_public_decrypt</a> — 使用公钥解密数据</li><li><a href="function.openssl-public-encrypt.php">openssl_public_encrypt</a> — 使用公钥加密数据</li><li><a href="function.openssl-random-pseudo-bytes.php">openssl_random_pseudo_bytes</a> — 生成一个伪随机字节串</li><li><a href="function.openssl-seal.php">openssl_seal</a> — 密封 (加密) 数据</li><li><a href="function.openssl-sign.php">openssl_sign</a> — Generate signature</li><li><a href="function.openssl-spki-export.php">openssl_spki_export</a> — 通过签名公钥和 challenge 导出一个可用的 PEM 格式的公钥</li><li><a href="function.openssl-spki-export-challenge.php">openssl_spki_export_challenge</a> — 导出与签名公钥和 challenge 相关的 challenge</li><li><a href="function.openssl-spki-new.php">openssl_spki_new</a> — 生成新的签名公钥和 challenge</li><li><a href="function.openssl-spki-verify.php">openssl_spki_verify</a> — 验证签名公钥和 challenge</li><li><a href="function.openssl-verify.php">openssl_verify</a> — 验证签名</li><li><a href="function.openssl-x509-check-private-key.php">openssl_x509_check_private_key</a> — 检查私钥是否对应于证书</li><li><a href="function.openssl-x509-checkpurpose.php">openssl_x509_checkpurpose</a> — 验证是否可以为特定目的使用证书</li><li><a href="function.openssl-x509-export.php">openssl_x509_export</a> — 以字符串格式导出证书</li><li><a href="function.openssl-x509-export-to-file.php">openssl_x509_export_to_file</a> — 导出证书至文件</li><li><a href="function.openssl-x509-fingerprint.php">openssl_x509_fingerprint</a> — 计算一个给定的 x.509 证书的指纹或摘要</li><li><a href="function.openssl-x509-free.php">openssl_x509_free</a> — 释放证书资源</li><li><a href="function.openssl-x509-parse.php">openssl_x509_parse</a> — 解析 X509 证书并作为一个数组返回信息</li><li><a href="function.openssl-x509-read.php">openssl_x509_read</a> — 解析 x.509 证书并返回对象</li><li><a href="function.openssl-x509-verify.php">openssl_x509_verify</a> — Verifies digital signature of x509 certificate against a public key</li></ul></li><li><a href="class.opensslcertificate.php">OpenSSLCertificate</a> — OpenSSLCertificate 类</li><li><a href="class.opensslcertificatesigningrequest.php">OpenSSLCertificateSigningRequest</a> — OpenSSLCertificateSigningRequest 类</li><li><a href="class.opensslasymmetrickey.php">OpenSSLAsymmetricKey</a> — OpenSSLAsymmetricKey 类</li></ul></div><?php manual_footer($setup); ?>