openssl_verify的用法!?

anglefox 2013-11-05 02:31:34
openssl_verify的用法是什么?
我想知道他的三个参数分别传递什么值!
...全文
520 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
anglefox 2013-11-14
  • 打赏
  • 举报
回复
/** * Determine if one cert was used to sign another * Note that more than one CA cert can give a positive result, some certs * re-issue signing certs after having only changed the expiration dates. * @param string $cert - PEM encoded cert * @param string $caCert - PEM encoded cert that possibly signed $cert * @return bool */ function isCertSigner($certPem=null,$caCertPem=null) { if (!function_exists('openssl_pkey_get_public')) { die('Need the openssl_pkey_get_public() function.'); } if (!function_exists('openssl_public_decrypt')) { die('Need the openssl_public_decrypt() function.'); } if (!function_exists('hash')) { die('Need the php hash() function.'); } if (empty($certPem) or empty($caCertPem)) { return false; } // Convert the cert to der for feeding to extractSignature. $certDer = $this->pemToDer($certPem); if (!is_string($certDer)) { die('invalid certPem'); } // Grab the encrypted signature from the der encoded cert. $encryptedSig = $this->extractSignature($certDer); if (!is_string($encryptedSig)) { die('Failed to extract encrypted signature from certPem.'); } // Extract the public key from the ca cert, which is what has // been used to encrypt the signature in the cert. $pubKey = openssl_pkey_get_public($caCertPem); if ($pubKey === false) { die('Failed to extract the public key from the ca cert.'); } // Attempt to decrypt the encrypted signature using the CA's public // key, returning the decrypted signature in $decryptedSig. If // it can't be decrypted, this ca was not used to sign it for sure... $rc = openssl_public_decrypt($encryptedSig,$decryptedSig,$pubKey); if ($rc === false) { return false; } // We now have the decrypted signature, which is der encoded // asn1 data containing the signature algorithm and signature hash. // Now we need what was originally hashed by the issuer, which is // the original DER encoded certificate without the issuer and // signature information. $origCert = $this->stripSignerAsn($certDer); if ($origCert === false) { die('Failed to extract unsigned cert.'); } // Get the oid of the signature hash algorithm, which is required // to generate our own hash of the original cert. This hash is // what will be compared to the issuers hash. $oid = $this->getSignatureAlgorithmOid($decryptedSig); if ($oid === false) { die('Failed to determine the signature algorithm.'); } switch($oid) { case '1.2.840.113549.2.2': $algo = 'md2'; break; case '1.2.840.113549.2.4': $algo = 'md4'; break; case '1.2.840.113549.2.5': $algo = 'md5'; break; case '1.3.14.3.2.18': $algo = 'sha'; break; case '1.3.14.3.2.26': $algo = 'sha1'; break; case '2.16.840.1.101.3.4.2.1': $algo = 'sha256'; break; case '2.16.840.1.101.3.4.2.2': $algo = 'sha384'; break; case '2.16.840.1.101.3.4.2.3': $algo = 'sha512'; break; default: die('Unknown signature hash algorithm oid: ' . $oid); break; } // Get the issuer generated hash from the decrypted signature. $decryptedHash = $this->getSignatureHash($decryptedSig); // Ok, hash the original unsigned cert with the same algorithm // and if it matches $decryptedHash we have a winner. $certHash = hash($algo,$origCert); return ($decryptedHash === $certHash); } /** * Convert pem encoded certificate to DER encoding * @return string $derEncoded on success * @return bool false on failures */ function pemToDer($pem=null) { if (!is_string($pem)) { return false; } $cert_split = preg_split('/(-----((BEGIN)|(END)) CERTIFICATE-----)/',$pem); if (!isset($cert_split[1])) { return false; } return base64_decode($cert_split[1]); } /** * Obtain der cert with issuer and signature sections stripped. * @param string $der - der encoded certificate * @return string $der on success * @return bool false on failures. */ function stripSignerAsn($der=null) { if (!is_string($der) or strlen($der) < 8) { return false; } $bit = 4; $len = ord($der[($bit + 1)]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$bit + $i + 2]); } } return substr($der,4,$len + 4); } } /** * HTML form starts here... */ $this->answer = 'Enter PEM Encoded Certificates for the Issuer and Subject ' . 'and click Submit. Include the entire certificates, including ' . 'the BEGIN CERTIFICATE and END CERTIFICATE lines.'; /* if (isset($_POST['subjectPem']) and isset($_POST['issuerPem'])) { if (strlen($_POST['subjectPem']) > 0 and strlen($_POST['issuerPem']) > 0) { $rc = isCertSigner($_POST['subjectPem'],$_POST['issuerPem']); if ($rc === true) { $answer = 'The issuer cert DID sign the subject cert.'; } else { $answer = 'The issuer cert DID NOT sign the subject cert.'; } } } */ ?>
anglefox 2013-11-14
  • 打赏
  • 举报
回复
已经解决了! 在网上找了个类,可以。 <?php /** * Is one pem encoded certificate the signer of another? * * The PHP openssl functionality is severely limited by the lack of a stable * api and documentation that might as well have been encrypted itself. * In particular the documention on openssl_verify() never explains where * to get the actual signature to verify. The isCertSigner() function below * will accept two PEM encoded certs as arguments and will return true if * one certificate was used to sign the other. It only relies on the * openssl_pkey_get_public() and openssl_public_decrypt() openssl functions, * which should stay fairly stable. The ASN parsing code snippets were mostly * borrowed from the horde project's smime.php. * * @author Mike Green <mikey at badpenguins dot com> * @copyright Copyright (c) 2010, Mike Green * @license http://opensource.org/licenses/gpl-2.0.php GPLv2 */ /** * If viewSource is in the request string, show the source, luke. if (isset($_REQUEST['viewSource'])) { die(highlight_file(__FILE__)); } */ class OpensslVerifyAPI { /** * Extract signature from der encoded cert. * Expects x509 der encoded certificate consisting of a section container * containing 2 sections and a bitstream. The bitstream contains the * original encrypted signature, encrypted by the public key of the issuing * signer. * @param string $der * @return string on success * @return bool false on failures */ function extractSignature($der=false) { if (strlen($der) < 5) { return false; } // skip container sequence $der = substr($der,4); // now burn through two sequences and the return the final bitstream while(strlen($der) > 1) { $class = ord($der[0]); $classHex = dechex($class); switch($class) { // BITSTREAM case 0x03: $len = ord($der[1]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for ($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$i + 2]); } } return substr($der,3 + $bytes, $len); break; // SEQUENCE case 0x30: $len = ord($der[1]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$i + 2]); } } $contents = substr($der, 2 + $bytes, $len); $der = substr($der,2 + $bytes + $len); break; default: return false; break; } } return false; } /** * Get signature algorithm oid from der encoded signature data. * Expects decrypted signature data from a certificate in der format. * This ASN1 data should contain the following structure: * SEQUENCE * SEQUENCE * OID (signature algorithm) * NULL * OCTET STRING (signature hash) * @return bool false on failures * @return string oid */ function getSignatureAlgorithmOid($der=null) { // Validate this is the der we need... if (!is_string($der) or strlen($der) < 5) { return false; } $bit_seq1 = 0; $bit_seq2 = 2; $bit_oid = 4; if (ord($der[$bit_seq1]) !== 0x30) { die('Invalid DER passed to getSignatureAlgorithmOid()'); } if (ord($der[$bit_seq2]) !== 0x30) { die('Invalid DER passed to getSignatureAlgorithmOid()'); } if (ord($der[$bit_oid]) !== 0x06) { die('Invalid DER passed to getSignatureAlgorithmOid'); } // strip out what we don't need and get the oid $der = substr($der,$bit_oid); // Get the oid $len = ord($der[1]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for ($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$i + 2]); } } $oid_data = substr($der, 2 + $bytes, $len); // Unpack the OID $oid = floor(ord($oid_data[0]) / 40); $oid .= '.' . ord($oid_data[0]) % 40; $value = 0; $i = 1; while ($i < strlen($oid_data)) { $value = $value << 7; $value = $value | (ord($oid_data[$i]) & 0x7f); if (!(ord($oid_data[$i]) & 0x80)) { $oid .= '.' . $value; $value = 0; } $i++; } return $oid; } /** * Get signature hash from der encoded signature data. * Expects decrypted signature data from a certificate in der format. * This ASN1 data should contain the following structure: * SEQUENCE * SEQUENCE * OID (signature algorithm) * NULL * OCTET STRING (signature hash) * @return bool false on failures * @return string hash */ function getSignatureHash($der=null) { // Validate this is the der we need... if (!is_string($der) or strlen($der) < 5) { return false; } if (ord($der[0]) !== 0x30) { die('Invalid DER passed to getSignatureHash()'); } // strip out the container sequence $der = substr($der,2); if (ord($der[0]) !== 0x30) { die('Invalid DER passed to getSignatureHash()'); } // Get the length of the first sequence so we can strip it out. $len = ord($der[1]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for ($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$i + 2]); } } $der = substr($der, 2 + $bytes + $len); // Now we should have an octet string if (ord($der[0]) !== 0x04) { die('Invalid DER passed to getSignatureHash()'); } $len = ord($der[1]); $bytes = 0; if ($len & 0x80) { $bytes = $len & 0x0f; $len = 0; for ($i = 0; $i < $bytes; $i++) { $len = ($len << 8) | ord($der[$i + 2]); } } return bin2hex(substr($der, 2 + $bytes, $len)); }
jdgdf566 2013-11-07
  • 打赏
  • 举报
回复
这个一般可以不管。
anglefox 2013-11-06
  • 打赏
  • 举报
回复
[quote=引用 2 楼 sjqzone 的回复:] $signature公钥加密生成的数据,$data原始数据 你是说$signature 是$pub_key_id 加密生成的?如何加密?
sjqzone 2013-11-05
  • 打赏
  • 举报
回复
$signature公钥加密生成的数据,$data原始数据 $fp = fopen("pem公钥", "r"); $cert = fread($fp, 8192); fclose($fp); $pub_key_id = openssl_get_publickey($cert);
anglefox 2013-11-05
  • 打赏
  • 举报
回复
$pub_key_id 毫无悬疑是公钥!其他两个参数$data 和 $signature分别表示什么意思?
第一章 基础知识 8
1.1 对称算法 8
1.2摘要算法 8
1.3 公钥算法 9
1.4 回调函数 11
第二章 openssl简介 13
2.1 openssl简介 13
2.2 openssl安装 13
2.2.1 linux下的安装 13
2.2.2 windows编译与安装 13
2.3 openssl源代码 14
2.4 openssl学习方法 16
第三章openssl堆栈 17
3.1 openssl堆栈 17
3.2 数据结构 17
3.3 源码 17
3.4 定义用户自己的堆栈函数 18
3.5 编程示例 19
第四章 openssl哈希表 21
4.1 哈希表 21
4.2 哈希表数据结构 21
4.3 函数说明 22
4.4 编程示例 24
第五章 openssl内存分配 27
5.1 openssl内存分配 27
5.2 内存数据结构 27
5.3 主要函数 28
5.4 编程示例 28
第六章 Openssl动态模块加载 31
6.1 动态库加载 31
6.2 DSO概述 31
6.3 数据结构 31
6.4 编程示例 32
第七章 openssl抽象IO 35
7.1 openssl抽象IO 35
7.2 数据结构 35
7.3 BIO 函数 36
7.4 编程示例 37
7.4.1 mem bio 37
7.4.2 file bio 37
7.4.3 socket bio 38
7.4.4 md BIO 40
7.4.5 cipher BIO 40
7.4.6 ssl BIO 41
7.4.7 其他示例 43
第八章 Openssl配置文件 44
8.1 概述 44
8.2 openssl配置文件读取 44
8.3 主要函数 44
8.4 编程示例 45
第九章 Openssl随机数 47
9.1 随机数 47
9.2 openssl随机数数据结构与源码 47
9.3 主要函数 48
9.4 编程示例 49
第十章 Openssl文本数据库 51
10.1 概述 51
10.2 数据结构 51
10.3 函数说明 52
10.4 编程示例 52
第十一章 Openssl大数 55
11.1 介绍 55
11.2 openssl大数表示 55
11.3 大数函数 55
11.4 使用示例 58
第十二章 Openssl base64编解码 65
12.1 BASE64编码介绍 65
12.2 BASE64编解码原理 65
12.3 主要函数 66
12.4 编程示例 66
第十三章 Openssl ASN1库 69
13.1 ASN1简介 69
13.2 DER编码 70
13.3 ASN1基本类型示例 71
13.4 openssl 的ASN.1库 73
13.5 用openssl的ASN.1库DER编码 74
13.6 Openssl的ASN.1宏 75
13.7 ASN1常用函数 76
13.8 属性证书编码 90
第十四章 Openssl错误处理 94
14.1 概述 94
14.2 数据结构 94
14.3 主要函数 96
14.4 编程示例 98
第十五章 Openssl摘要与HMAC 101
15.1 概述 101
15.2 openssl摘要实现 101
15.3 函数说明 101
15.4 编程示例 102
15.5 HMAC 103
第十六章 Openssl数据压缩 105
16.1 简介 105
16.2 数据结构 105
16.3 函数说明 106
16.4 openssl中压缩算法协商 106
16.5 编程示例 107
第十七章 Openssl RSA 108
17.1 RSA介绍 108
17.2 openssl的RSA实现 108
17.3 RSA签名与验证过程 109
17.4 数据结构 109
17.4.1 RSA_METHOD 109
17.4.2 RSA 110
17.5 主要函数 111
17.6编程示例 112
17.6.1密钥生成 112
17.6.2 RSA加解密运算 114
17.6.3签名与验证 117
第十八章 Openssl DSA 120
18.1 DSA简介 120
18.2 openssl的DSA实现 120
18.3 DSA数据结构 121
18.4 主要函数 122
18.5 编程示例 123
18.5.1密钥生成 123
18.5.2签名与验证 124
第十九章Openssl DH 127
19.1 DH算法介绍 127
19.2 openssl的DH实现 127
19.3数据结构 128
19.4 主要函数 129
19.5 编程示例 130
第二十章 Openssl椭圆曲线 133
20.1 ECC介绍 133
20.2 openssl的ECC实现 133
20.3 主要函数 134
20.4 编程示例 134
第二十一章 Openssl EVP 138
21.1 EVP简介 138
21.2 数据结构 138
21.2.1 EVP_PKEY 138
21.2.2 EVP_MD 139
21.2.3 EVP_CIPHER 140
21.2.4 EVP_CIPHER_CTX 141
21.3 源码结构 141
21.4 摘要函数 142
21.5 对称加解密函数 142
21.6 非对称函数 143
21.7 BASE64编解码函数 144
21.8其他函数 144
21.9 对称加密过程 146
21.10 编程示例 147
第二十二章 Openssl PEM格式 154
22.1 PEM概述 154
22.2 openssl的PEM实现 154
22.3 PEM函数 155
22.4 编程示例 156
第二十三章 Openssl Engine 160
23.1 Engine概述 160
23.2 Engine支持的原理 160
23.3 Engine数据结构 160
23.4 openssl 的Engine源码 161
23.5 Engine函数 162
23.6 实现Engine示例 163
第二十四章 Openssl 通用数据结构 177
24.1通用数据结构 177
24.2 X509_ALGOR 177
24.3 X509_VAL 178
24.4 X509_SIG 180
24.5 X509_NAME_ENTRY 181
24.6 X509_NAME 181
24.7 X509_EXTENSION 187
24.8 X509_ATTRIBUTE 193
24.9 GENERAL_NAME 195
第二十五章 Openssl 证书申请 198
25.1 证书申请介绍 198
25.2 数据结构 198
25.3 主要函数 199
25.4 编程示例 201
25.4.1生成证书请求文件 201
25.4.2 解码证书请求文件 203
第二十六章 Openssl X509数字证书 205
26.1 X509数字证书 205
26.2 opessl实现 205
26.3 X509数据结构 205
26.4 X509_TRUST与X509_CERT_AUX 208
26.5 X509_PURPOSE 210
26.6 主要函数 213
26.7 证书验证 216
26.7.1证书验证项 216
26.7.2 Openssl中的证书验证 216
第二十七章 Openssl OCSP 217
27.1 概述 217
27.2 openssl实现 217
27.3 主要函数 217
27.4编程示例 222
第二十八章 Openssl CRL 223
28.1 CRL介绍 223
28.2 数据结构 223
28.3 CRL函数 224
28.4 编程示例 226
第二十九章 Openssl PKCS7 228
29.1概述 228
29.2 数据结构 228
29.3 函数 229
29.4 消息编解码 229
29.4.1 data 230
29.4.2 signed data 230
29.4.3 enveloped 231
29.4.4 signed_and_enveloped 232
29.4.5 digest 233
29.4.6 encrypted 233
29.4.7 读取PEM 234
29.4.8 解码pkcs7 235
第三十章 Openssl PKCS12 236
30.1 概述 236
30.2 openss实现 236
30.3数据结构 236
30.4函数 237
30.5 编程示例 239
第三十一章 Openssl SSL实现 249
31.1概述 249
31.2 openssl实现 249
31.3 建立SSL测试环境 249
31.4 数据结构 250
31.5 加密套件 251
31.6 密钥信息 252
31.7 SESSION 252
31.8 多线程支持 253
31.9 编程示例 253
31.10 函数 264
第三十二章 Openssl命令 267
32.1概述 267
32.2 asn1parse 267
32.3 dgst 269
32.4 gendh 270
32.5 passwd 270
32.6 rand 271
32.7 genrsa 271
32.8 req 272
32.9 x509 274
32.10 version 277
32.11 speed 277
32.12 sess_id 278
32.13 s_server 278
32.14 s_client 280
32.15 rsa 282
32.16 pkcs7 283
32.17 dsaparam 284
32.18 gendsa 284
32.19 enc 285
32.20 ciphers 286
32.21 CA 287
32.22 verify 291
32.23 rsatul 292
32.24 crl 293
32.25 crl2pkcs7 294
32.26 errstr 294
32.27 ocsp 295
32.28 pkcs12 298
32.29 pkcs8 300
32.30 s_time 301
32.31 dhparam和dh 302
32.32 ecparam 303
32.33 ec 304
32.34 dsa 305
32.35 nseq 306
32.36 prime 307
32.37 smime 307
openssl 编程 当前版本 赵春平 著 第一章 基础知识 8 1.1 对称算法 8 1.2 摘要算法 9 1.3 公钥算法 9 1.4 回调函数 11 第二章 openssl简介 13 2.1 openssl简介 13 2.2 openssl安装 13 2.2.1 linux下的安装 13 2.2.2 windows编译与安装 14 2.3 openssl源代码 14 2.4 openssl学习方法 16 第三章 堆栈 17 3.1 openssl堆栈 17 3.2 数据结构 17 3.3 源码 18 3.4 定义用户自己的堆栈函数 18 3.5 编程示例 19 第四章 哈希表 21 4.1 哈希表 21 4.2 哈希表数据结构 21 4.3 函数说明 23 4.4 编程示例 25 第五章 内存分配 27 5.1 openssl内存分配 27 5.2 内存数据结构 27 5.3 主要函数 28 5.4 编程示例 29 第六章 动态模块加载 30 6.1 动态库加载 30 6.2 DSO概述 30 6.3 数据结构 31 6.4 编程示例 32 第七章 抽象IO 34 7.1 openssl抽象IO 34 7.2 数据结构 34 7.3 BIO 函数 36 7.4 编程示例 36 7.4.1 mem bio 36 7.4.2 file bio 37 7.4.3 socket bio 38 7.4.4 md BIO 39 7.4.5 cipher BIO 40 7.4.6 ssl BIO 41 7.4.7 其他示例 42 第八章 配置文件 43 8.1 概述 43 8.2 openssl配置文件读取 43 8.3 主要函数 44 8.4 编程示例 44 第九章 随机数 46 9.1 随机数 46 9.2 openssl随机数数据结构与源码 46 9.3 主要函数 48 9.4 编程示例 48 第十章 文本数据库 50 10.1 概述 50 10.2 数据结构 51 10.3 函数说明 51 10.4 编程示例 52 第十一章 大数 54 11.1 介绍 54 11.2 openssl大数表示 54 11.3 大数函数 55 11.4 使用示例 58 第十二章 BASE64编解码 64 12.1 BASE64编码介绍 64 12.2 BASE64编解码原理 64 12.3 主要函数 65 12.4 编程示例 66 第十三章 ASN1库 68 13.1 ASN1简介 68 13.2 DER编码 70 13.3 ASN1基本类型示例 70 13.4 openssl 的ASN.1库 73 13.5 用openssl的ASN.1库DER编解码 74 13.6 Openssl的ASN.1宏 74 13.7 ASN1常用函数 75 13.8 属性证书编码 89 第十四章 错误处理 93 14.1 概述 93 14.2 数据结构 93 14.3 主要函数 95 14.4 编程示例 97 第十五章 摘要与HMAC 100 15.1 概述 100 15.2 openssl摘要实现 100 15.3 函数说明 101 15.4 编程示例 101 15.5 HMAC 103 第十六章 数据压缩 104 16.1 简介 104 16.2 数据结构 104 16.3 函数说明 105 16.4 openssl中压缩算法协商 106 16.5 编程示例 106 第十七章 RSA 107 17.1 RSA介绍 107 17.2 openssl的RSA实现 107 17.3 RSA签名与验证过程 108 17.4 数据结构 109 17.4.1 RSA_METHOD 109 17.4.2 RSA 110 17.5 主要函数 110 17.6编程示例 112 17.6.1密钥生成 112 17.6.2 RSA加解密运算 113 17.6.3签名与验证 116 第十八章 DSA 119 18.1 DSA简介 119 18.2 openssl的DSA实现 120 18.3 DSA数据结构 120 18.4 主要函数 121 18.5 编程示例 122 18.5.1密钥生成 122 18.5.2签名与验证 124 第十九章DH 126 19.1 DH算法介绍 126 19.2 openssl的DH实现 127 19.3数据结构 127 19.4 主要函数 128 19.5 编程示例 129 第二十章 椭圆曲线 132 20.1 ECC介绍 132 20.2 openssl的ECC实现 133 20.3 主要函数 135 20.3.1参数设置 135 20.3.2参数获取 136 20.3.3转化函数 137 20.3.4其他函数 137 20.4 编程示例 139 第二十一章 EVP 143 21.1 EVP简介 143 21.2 数据结构 143 21.2.1 EVP_PKEY 144 21.2.2 EVP_MD 144 21.2.3 EVP_CIPHER 145 21.2.4 EVP_CIPHER_CTX 146 21.3 源码结构 147 21.4 摘要函数 147 21.5 对称加解密函数 148 21.6 非对称函数 149 21.7 BASE64编解码函数 149 21.8其他函数 150 21.9 对称加密过程 152 21.10 编程示例 152 第二十二章 PEM格式 159 22.1 PEM概述 159 22.2 openssl的PEM实现 160 22.3 PEM函数 161 22.4 编程示例 161 第二十三章 Engine 165 23.1 Engine概述 165 23.2 Engine支持的原理 165 23.3 Engine数据结构 166 23.4 openssl 的Engine源码 167 23.5 Engine函数 167 23.6 实现Engine示例 169 第二十四章 通用数据结构 182 24.1通用数据结构 182 24.2 X509_ALGOR 182 24.3 X509_VAL 184 24.4 X509_SIG 185 24.5 X509_NAME_ENTRY 186 24.6 X509_NAME 187 24.7 X509_EXTENSION 193 24.8 X509_ATTRIBUTE 199 24.9 GENERAL_NAME 200 第二十五章 证书申请 203 25.1 证书申请介绍 203 25.2 数据结构 203 25.3 主要函数 204 25.4 编程示例 206 25.4.1生成证书请求文件 206 25.4.2 解码证书请求文件 208 第二十六章 X509数字证书 210 26.1 X509数字证书 210 26.2 opessl实现 210 26.3 X509数据结构 210 26.4 X509_TRUST与X509_CERT_AUX 214 26.5 X509_PURPOSE 215 26.6 主要函数 218 26.7 证书验证 221 26.7.1证书验证项 221 26.7.2 Openssl中的证书验证 221 第二十七章 OCSP 222 27.1 概述 222 27.2 openssl实现 222 27.3 主要函数 222 27.4编程示例 227 第二十八章 CRL 228 28.1 CRL介绍 228 28.2 数据结构 228 28.3 CRL函数 230 28.4 编程示例 231 第二十九章 PKCS7 233 29.1概述 233 29.2 数据结构 233 29.3 函数 234 29.4 消息编解码 235 29.4.1 data 235 29.4.2 signed data 236 29.4.3 enveloped 237 29.4.4 signed_and_enveloped 238 29.4.5 digest 238 29.4.6 encrypted 239 29.4.7 读取PEM 239 29.4.8 解码pkcs7 240 第三十章 PKCS12 241 30.1 概述 241 30.2 openss实现 241 30.3数据结构 242 30.4函数 243 30.5 编程示例 245 第三十一章 SSL实现 254 31.1概述 254 31.2 openssl实现 254 31.3 建立SSL测试环境 254 31.4 数据结构 256 31.5 加密套件 256 31.6 密钥信息 257 31.7 SESSION 258 31.8 多线程支持 258 31.9 编程示例 259 31.10 函数 270 第三十二章 Openssl命令 272 32.1概述 272 32.2 asn1parse 272 32.3 dgst 274 32.4 gendh 275 32.5 passwd 276 32.6 rand 276 32.7 genrsa 277 32.8 req 278 32.9 x509 280 32.10 version 283 32.11 speed 283 32.12 sess_id 284 32.13 s_server 284 32.14 s_client 286 32.15 rsa 288 32.16 pkcs7 289 32.17 dsaparam 290 32.18 gendsa 291 32.19 enc 291 32.20 ciphers 292 32.21 CA 293 32.22 verify 296 32.23 rsatul 297 32.24 crl 299 32.25 crl2pkcs7 300 32.26 errstr 300 32.27 ocsp 301 32.28 pkcs12 304 32.29 pkcs8 306 32.30 s_time 307 32.31 dhparam和dh 308 32.32 ecparam 309 32.33 ec 310 32.34 dsa 311 32.35 nseq 312 32.36 prime 313 32.37 smime 313
第一章 基础知识 81.1 对称算法 81.2摘要算法 81.3 公钥算法 91.4 回调函数 11第二章 openssl简介 132.1 openssl简介 132.2 openssl安装 132.2.1 linux下的安装 132.2.2 windows编译与安装 132.3 openssl源代码 142.4 openssl学习方法 16第三章openssl堆栈 173.1 openssl堆栈 173.2 数据结构 173.3 源码 173.4 定义用户自己的堆栈函数 183.5 编程示例 19第四章 openssl哈希表 214.1 哈希表 214.2 哈希表数据结构 214.3 函数说明 224.4 编程示例 24第五章 openssl内存分配 275.1 openssl内存分配 275.2 内存数据结构 275.3 主要函数 285.4 编程示例 28第六章 Openssl动态模块加载 316.1 动态库加载 316.2 DSO概述 316.3 数据结构 316.4 编程示例 32第七章 openssl抽象IO 357.1 openssl抽象IO 357.2 数据结构 357.3 BIO 函数 367.4 编程示例 377.4.1 mem bio 377.4.2 file bio 377.4.3 socket bio 387.4.4 md BIO 407.4.5 cipher BIO 407.4.6 ssl BIO 417.4.7 其他示例 43第八章 Openssl配置文件 448.1 概述 448.2 openssl配置文件读取 448.3 主要函数 448.4 编程示例 45第九章 Openssl随机数 479.1 随机数 479.2 openssl随机数数据结构与源码 479.3 主要函数 489.4 编程示例 49第十章 Openssl文本数据库 5110.1 概述 5110.2 数据结构 5110.3 函数说明 5210.4 编程示例 52第十一章 Openssl大数 5511.1 介绍 5511.2 openssl大数表示 5511.3 大数函数 5511.4 使用示例 58第十二章 Openssl base64编解码 6512.1 BASE64编码介绍 6512.2 BASE64编解码原理 6512.3 主要函数 6612.4 编程示例 66第十三章 Openssl ASN1库 6913.1 ASN1简介 6913.2 DER编码 7013.3 ASN1基本类型示例 7113.4 openssl 的ASN.1库 7313.5 用openssl的ASN.1库DER编码 7413.6 Openssl的ASN.1宏 7513.7 ASN1常用函数 7613.8 属性证书编码 90第十四章 Openssl错误处理 9414.1 概述 9414.2 数据结构 9414.3 主要函数 9614.4 编程示例 98第十五章 Openssl摘要与HMAC 10115.1 概述 10115.2 openssl摘要实现 10115.3 函数说明 10115.4 编程示例 10215.5 HMAC 103第十六章 Openssl数据压缩 10516.1 简介 10516.2 数据结构 10516.3 函数说明 10616.4 openssl中压缩算法协商 10616.5 编程示例 107第十七章 Openssl RSA 10817.1 RSA介绍 10817.2 openssl的RSA实现 10817.3 RSA签名与验证过程 10917.4 数据结构 10917.4.1 RSA_METHOD 10917.4.2 RSA 11017.5 主要函数 11117.6编程示例 11217.6.1密钥生成

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧