制作CA证书
本文以Windows环境为例,介绍通过Openssl工具制作CA证书和验证证书的方法。

以下“生成密钥对(server.key)”和“生成CA证书(server.crt)”为操作过程中需要使用到的两个文件。
制作CA证书
- 在浏览器中访问这里,下载并进行安装OpenSSL工具,安装完成后配置环境变量。
- 在 D:\certificates 文件夹下,以管理员身份运行cmd命令行窗口。
- 生成密钥对(server.key):
生成“密钥对”时输入的密码在生成“证书请求文件”、“CA证书”以及“验证证书”时需要用到,请妥善保存。
openssl genrsa -des3 -out server.key 2048
- 使用密钥对生成证书请求文件:
表1 提示
参数名称
取值样例
Country Name (2 letter code) []:
国家/地区
CN
State or Province Name (full name) []:
省/市
GuangDong
Locality Name (eg, city) []:
城市
ShenZhen
Organization Name (eg, company) []:
组织机构(或公司名)
Huawei Technologies Co., Ltd.
Organizational Unit Name (eg, section) []:
机构部门
Cloud Dept.
Common Name (eg, fully qualified host name) []:
CA名称(CN)
Huawei IoTDP CA
Email Address []:
邮箱地址
/
A challenge password []:
证书密码,如您不设置密码,可以直接回车
/
openssl req -new -key server.key -out server.csr
- 生成CA证书(server.crt):
openssl x509 -req -days 50000 -in server.csr -signkey server.key -out server.crt
