没有合适的资源?快使用搜索试试~ 我知道了~
使用 OpenSSL 创建生成CA 证书服务器客户端证书及密钥
需积分: 5 5 下载量 83 浏览量
2024-01-16
08:57:15
上传
评论
收藏 1.66MB PDF 举报
温馨提示
试读
36页
使用OpenSSL生成密钥与证书,并进行双向验证
资源推荐
资源详情
资源评论
使用 OpenSSL 创建生成 CA 证书、服务器、
客户端证书及密钥
说明
对于 SSL 单向认证
服务器需要 CA 证书、server 证书、server 私钥,客户端需要 CA 证。
对于 SSL 双向认证
服务器需要 CA 证书、server 证书、server 私钥,客户端需要 CA 证书,client 证书、client 私
钥。
生成 CA 证书
私钥生成指令: openssl genrsa
该命令是会用来生成 RSA 私有秘钥,不会生成公钥,因为公钥提取自私钥。
openssl genrsa [-out filename] [-passout arg] [-f4] [-3] [-rand file(s)] [-engine id] [numbits]
[-des] [-des3] [-idea]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-idea encrypt the generated key with IDEA in cbc mode
-seed
encrypt PEM output with cbc seed
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to 'file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value
-engine e use engine e, possibly a hardware device.
-rand file:file:...
load the file (or the files in the directory) into
the random number generator
-des 使用 des cbc 模式对私钥文件进行加密。
-des3 使用 des3 cbc 模式对私钥文件进行加密。
-idea 使用 idea cbc 模式对私钥文件进行加密。
-aes128, -aes192, -aes256 使用 aes cbc 模式对私钥文件进行加密。
-out file 指定输出私钥文件名。
-f4 指定 F4 做为 E 值,默认。
-3 指定 3 做为 E 值。
-seed arg 指定 cbc 的随机种子。
-rand file:file 指定随机数种子文件。
———————————————————————————————————————
-out filename :将生成的私钥保存至 filename 文件,若未指定输出文件,则为标准输出。
-numbits :指定要生成的私钥的长度(单位 bit),默认为 1024。该项必须为命令行的最后
一项参数。
-des|-des3|-idea:指定加密私钥文件用的算法,这样每次使用私钥文件都将输入密码,太麻
烦所以很少使用。
-passout args :加密私钥文件时,传递密码的格式,如果要加密私钥文件时单未指定该项,
则提示输入密码。传递密码的 args 的格式见 openssl 密码格式。
测试
1、 openssl genrsa -seed -out rs_pri.pem 512
2、 openssl genrsa -aes256 –out rs_pri.key 512
3、 openssl genrsa -des3 -out test.key -rand hello.txt 512
4 、openssl genrsa -des -passout pass:"123456" -out prikey.pem 1024
剩余35页未读,继续阅读
资源评论
可爱的我啊
- 粉丝: 194
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功