本文主要讲述使用openssl来生成ecdsa证书和RSA证书。
首先在openssl官网上下载openssl源码,然后进行编译安装。
这个过程本文不进行讲解。默认你的系统中已经安装好了openssl。
但是需要使用下载的源码。
本文中的代码等都是实测可用的。使用平台是linux,版本是ubuntu14.04
下面开始正文。
以下linux命令均在root用户下完成。
1、首先要创建一个CA
创建CA的方法是进去openssl的源码目录下的app/文件夹下。然后输入创建CA命令:
root@mzq-desktop:/home/mzq# cd Desktop/openssl-1.0.1j_mzq1/apps/
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# sh CA.sh -newca
2、生成RSA密钥
生成rsa密钥使用命令openssl genrsa
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl genrsa -out server.key 2048
Generating RSA private key, 2048 bit long modulus
...................+++
.........................+++
e is 65537 (0x10001)
3、生成ECDSA密钥
生成ecdsa密钥使用命令openssl ecparam
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl ecparam -name secp384r1 -genkey -out server-ecc.key
3、生成证书请求
生成证书请求使用命令openssl req
RSA证书请求:
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into 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 blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:beijing
Locality Name (eg, city) []:beijing
Organization Name (eg, company) [Internet Widgits Pty Ltd]:dcs
Organizational Unit Name (eg, section) []:dcs
Common Name (e.g. server FQDN or YOUR name) []:mzq
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
ECDSA证书请求:
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl req -new -key server-ecc.key -out server-ecc.csr
You are about to be asked to enter information that will be incorporated
into 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 blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:beijing
Locality Name (eg, city) []:beijing
Organization Name (eg, company) [Internet Widgits Pty Ltd]:dcs
Organizational Unit Name (eg, section) []:dcs
Common Name (e.g. server FQDN or YOUR name) []:mzq
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
4、签发证书
签发证书使用openssl ca命令
RSA证书:
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl ca -in server.csr -out server.crt -days 3650
Using configuration from /usr/local/ssl/openssl.cnf
Check that the request matches the signature
Signature ok
The countryName field needed to be the same in the
CA certificate (AU) and the request (CN)
ECDSA证书:
root@mzq-desktop:/home/mzq/Desktop/openssl-1.0.1j_mzq1/apps# openssl ca -in server-ecc.csr -out server-ecc.crt -days 3650
Using configuration from /usr/local/ssl/openssl.cnf
Check that the request matches the signature
Signature ok
The countryName field needed to be the same in the
CA certificate (AU) and the request (CN)
这样,证书就申请成功了。可以对证书进行使用。
相关推荐
scratch少儿编程逻辑思维游戏源码-上下飞行.zip
kkzhilu_Code-Generate_32152_1745864907745
艺术博客_SpringSpringMVCMybatisShirojQueryBootstrapechartswebuploaderlayui_博客管理图表数据日
scratch少儿编程逻辑思维游戏源码-面具古墓.zip
scratch少儿编程逻辑思维游戏源码-时钟上的冰块.zip
健康监测_Android开发_BLE蓝牙通信_心率数据采集与存储_基于小米手环2的实时心率监测应用_支持后台长时间运行的心率记录工具_可导出SQLite数据库的心率数据分析系统_适
scratch少儿编程逻辑思维游戏源码-梦魇忍者.zip
scratch少儿编程逻辑思维游戏源码-谁建得更高.zip
scratch少儿编程逻辑思维游戏源码-忍者攀登.zip
模拟端 后端 qt前端
数据可视化_Android原生Canvas绘图_3D与非3D柱形图饼图折线图面积图曲线图环形图玫瑰图雷达图散点图气泡图仪表盘刻度盘漏斗图象限图_支持手势缩放滑动交互多图叠加动画效果
scratch少儿编程逻辑思维游戏源码-米克 demo.zip
聚合支付系统/官方个人免签系统/三方支付系统稳定安全高并发 附教程 系统采用FastAdmin框架独立全新开发,安全稳定,系统支持代理、商户、码商等业务逻辑。 针对最近一些JD,TB等业务定制,子账号业务逻辑API 非常详细,方便内置对接! IP白名单 业务逻辑 支持IP白名单,黑名单,全局白名单,全局黑名单,保障系统的安全。 接口验签名 采用支付宝RSA加密接口方式,防止篡改数据,导致对账困难,资金大量损失,无故少钱 对接灵活 全部对接参数灵活操作 风控完善 轮询、交易金额、随机金额、最大金额、最小金额等 测试环境: Nginx+PHP7.0+MySQL5.6 网站运行目录:/public 伪静态设置为:thinkphp规则 数据库信息修改路径:/application/database.php
第一步 package.json 下载这三个包 shelljs :执行 shell命令 ssh2-sftp-client 与服务器建立链接(内部有ssh2) chalk 打印彩色输出 第二步 配置脚本命令 deploy 注意后边加上运行环境 执行deploy命令时内部执行了打包动作 「 "deploy": "node deploy/index.js --prod」 第三步准备服务器密码 账号 部署地址 备份地址等等 参考如下 放到 config.js 中 module.exports = [ { id: 0, nodeEnv: "prod", name: "正式环境", domain: "", host: "ip", port: 端口, username: "用户名", password: "密码", path: "/data/www/paccount",//部署路径 removepath: "/data/www/paccount", //删除路径 }, ]; 第四步 如果需要在服务器执行命令 在部署完成后执行 chmodDir 自行决定
scratch少儿编程逻辑思维游戏源码-恐怖矿井.zip
scratch少儿编程逻辑思维游戏源码-爬墙鸟.zip
scratch少儿编程逻辑思维游戏源码-亮灯.zip
scratch少儿编程逻辑思维游戏源码-神秘的游戏.zip
scratch少儿编程逻辑思维游戏源码-矿猫 V4.zip
scratch少儿编程逻辑思维游戏源码-射击游戏构建.zip