V1.0
查询关键词字:   
只需简单几步即可生成ssl证书生成工具

ssl证书生成工具是什么?想必都知道无论申请的是免费SSL证书还是ca颁发的SSL证书,都是要安装并生成证书方能正常使用。生成SSL证书的步骤也有所不同,有简单也有复杂的,那接下来,就在这里给大家简述下ssl证书的生成工具,然后再另外说下SSL证书的作用吧。


SSL证书的作用
SSL证书是数字证书的一种,类似于驾驶证、护照和营业执照的电子副本。
SSL证书的两大作用:数据加密和身份认证。
SSL 证书遵守 SSL协议,通过在客户端浏览器和Web服务器之间建立一条SSL安全通道。
一个有效、可信的 SSL 数字证书包括一个公共密钥和一个私用密钥。公共密钥用于加密信息,私用密钥用于解译加密的信息。因此,浏览器指向一个安全域的我们时,SSL 将同步确认服务器和客户端,并创建一种加密方式和一个唯一的会话密钥。它们可以启动一个保证消息的隐私性和完整性的安全会话。

简述ssl证书生成工具
1.创建根证书密钥文件:
openssl genrsa -des3 -out root.key
输出内容为:

[lenin@archer ~]$ openssl genrsa -des3 -out root.keyGenerating RSA private key, 512 bit long modulus……………..++++++++++++..++++++++++++e is 65537 (0×10001)Enter pass phrase for root.key: ← 输入一个新密码Verifying – Enter pass phrase for root.key: ← 重新输入一遍密码


2.创建根证书的申请文件root.csr:
openssl req -new -key root.key -out root.csr
输出内容为:
[lenin@archer ~]$ openssl req -new -key root.key -out root.csrEnter pass phrase for root.key: ← 输入前面创建的密码You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [AU]:CN ← 国家代号,中国输入CNState or Province Name (full name) [Some-State]:BeiJing ← 省的全名,拼音Locality Name (eg, city) []:BeiJing ← 市的全名,拼音Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名Organizational Unit Name (eg, section) []: ← 可以不输入Common Name (eg, YOUR name) []: ← 此时不输入Email Address []:admin@mycompany.com ← 电子邮箱,可随意填
Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []: ← 可以不输入An optional company name []: ← 可以不输入
3.创建一个自当前日期起为期一年的我们根证书root.crt:
openssl x509 -req -days 365 -sha1 -extensions v3_ca -signkey root.key -in root.req -out root.crt
输出内容为:
[lenin@archer ~]$ openssl x509 -req -days 365 -sha1 -extensions v3_ca -signkey root.key -in root.csr -out root.crtSignature oksubject=/C=CN/ST=BeiJing/L=BeiJing/O=MyCompany Corp./emailAddress=admin@mycompany.comGetting Private keyEnter pass phrase for root.key: ← 输入前面创建的密码
4.创建服务器证书密钥server.key:
openssl genrsa –des3 -out server.key 2048
输出内容为:
[lenin@archer ~]$ openssl genrsa -out server.key 2048Generating RSA private key, 2048 bit long modulus….+++…………………………………………..+++e is 65537 (0×10001)
运行时会提示输入密码,此密码用于加密key文件(参数des3便是指加密算法,当然也可以选用其他你认为安全的算法.),以后每当需读取此文件(通过openssl提供的命令或API)都需输入口令.如果觉得不方便,也可以去除这个口令,但一定要采取其他的保护措施!去除key文件口令的命令:openssl rsa -in server.key -out server.key
5.创建服务器证书的申请文件server.csr:
openssl req -new -key server.key -out server.csr
输出内容为:
[lenin@archer ~]$ openssl req -new -key server.key -out server.reqYou are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [AU]:CN ← 国家名称,中国输入CNState or Province Name (full name) [Some-State]:BeiJing ← 省名,拼音Locality Name (eg, city) []:BeiJing ← 市名,拼音Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名Organizational Unit Name (eg, section) []: ← 可以不输入Common Name (eg, YOUR name) []:www.mycompany.com ← 服务器主机名,若填写不正确,浏览器会报告证书无效,但并不影响使用Email Address []:admin@mycompany.com ← 电子邮箱,可随便填
Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []: ← 可以不输入An optional company name []: ← 可以不输入
6.创建自当前日期起有效期为期两年的服务器证书server.crt:
openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAserial root.srl -CAcreateserial -in server.csr -out server.crt
输出内容为:
[lenin@archer ~]$ openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crtSignature oksubject=/C=CN/ST=BeiJing/L=BeiJing/O=MyCompany Corp./CN=www.mycompany.com/emailAddress=admin@mycompany.comGetting CA Private KeyEnter pass phrase for root.key: ← 输入前面创建的密码
7.创建客户端证书密钥文件client.key:
openssl genrsa -des3 -out client.key 2048
输出内容为:
[lenin@archer ~]$ openssl genrsa -des3 -out client.key 2048Generating RSA private key, 2048 bit long modulus……………………………………………………………………………..+++……………………………………………………………………………………………………….+++e is 65537 (0×10001)Enter pass phrase for client.key: ← 输入一个新密码Verifying – Enter pass phrase for client.key: ← 重新输入一遍密码
8.创建客户端证书的申请文件client.csr:
openssl req -new -key client.key -out client.csr
输出内容为:
[lenin@archer ~]$ openssl req -new -key client.key -out client.csrEnter pass phrase for client.key: ← 输入上一步中创建的密码You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [AU]:CN ← 国家名称,中国输入CNState or Province Name (full name) [Some-State]:BeiJing ← 省名称,拼音Locality Name (eg, city) []:BeiJing ← 市名称,拼音Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名Organizational Unit Name (eg, section) []: ← 可以不填Common Name (eg, YOUR name) []:Lenin ← 自己的英文名,可以随便填Email Address []:admin@mycompany.com ← 电子邮箱,可以随便填
Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []: ← 可以不填An optional company name []: ← 可以不填
9.创建一个自当前日期起有效期为两年的客户端证书client.crt:
openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAserial root.srl -CAcreateserial -in client.csr -out client.crt
输出内容为:
[lenin@archer ~]$ openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in client.csr -out client.crtSignature oksubject=/C=CN/ST=BeiJing/L=BeiJing/O=MyCompany Corp./CN=www.mycompany.com/emailAddress=admin@mycompany.comGetting CA Private KeyEnter pass phrase for root.key: ← 输入上面创建的密码
10.将客户端证书文件client.crt和客户端证书密钥文件client.key合并成客户端证书安装包client.pfx:
openssl pkcs12 -export -in client.crt -inkey client.key -out client.pfx
输出内容为:
[lenin@archer ~]$ openssl pkcs12 -export -in client.crt -inkey client.key -out client.pfxEnter pass phrase for client.key: ← 输入上面创建的密码Enter Export Password: ← 输入一个新的密码,用作客户端证书的保护密码,在客户端安装证书时需要输入此密码Verifying – Enter Export Password: ← 确认密码
11.保存生成的文件备用,其中server.crt和server.key是配置单向SSL时需要使用的证书文件,client.crt是配置双向SSL时需要使用的证书文件,client.pfx是配置双向SSL时需要客户端安装的证书文件
.crt文件和.key可以合到一个文件里面,把2个文件合成了一个.pem文件(直接拷贝过去就行了)

ssl证书工具
SSL证书概述
SSL证书是数字证书的一种,类似于驾驶证、护照和营业执照的电子副本。因为配置在服务器上,也称为SSL服务器证书。
SSL 证书就是遵守SSL协议,由受信任的数字证书颁发机构CA,在验证服务器身份后颁发,具有服务器身份验证和数据传输加密功能。

SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secure socket layer(SSL)安全协议是由Netscape Communication公司设计开发。该安全协议主要用来提供对用户和服务器的认证;对传送的数据进行加密和隐藏;确保数据在传送中不被改变,即数据的完整性,现已成为该领域中全球化的标准。由于SSL技术已建立到所有主要的浏览器和WEB服务器程序中,因此,仅需安装服务器证书就可以激活该功能了),即通过它可以激活SSL协议,实现数据信息在客户端和服务器之间的加密传输,可以防止数据信息的泄露,保证了双方传递信息的安全性,而且用户可以通过服务器证书验证他所访问的网站是否是真实可靠。数字签名又名数字标识、签章 (即 Digital Certificate,Digital ID ),提供了一种在网上进行身份验证的方法,是用来标志和证明网络通信双方身份的数字信息文件,概念类似日常生活中的司机驾照或身份证。 数字签名主要用于发送安全电子邮件、访问安全站点、网上招标与投标、网上签约、网上订购、网上公文安全传送、网上办公、网上缴费、网上缴税以及网上购物等安全的网上电子交易活动。


以上就是给大家简述的ssl证书生成工具和SSL证书的作用的全部内容,本站的文章中还有很多关于ssl证书的相关文章,如果想深入了解ssl证书,就请关注下本站吧。