当前位置:网站首页>openssl 创建证书
openssl 创建证书
2022-08-08 10:57:00 【Zhi.C.Yue】
本文介绍 openssl 用法,创建证书命令示例。
代码如下:
1. 创建根证书
模拟 CA 机构
# 创建 CA 私钥
openssl genrsa -out ca.key 2048
# 制作 CA 公钥(证书)
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
2. 签发证书
# 创建密钥(私钥/公钥)
openssl genrsa -out a.pem 1024
openssl rsa -in a.pem -out a.key
# 生成签发请求
openssl req -new -key a.pem -out a.csr
# 使用 CA 证书进行签发
openssl x509 -req -sha256 -in a.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 3650 -out a.crt
# 验证签发证书是否正确
openssl verify -CAfile ca.crt a.crt
至此,结束。
边栏推荐
猜你喜欢
随机推荐
Postman使用简单演示
模式识别 学习笔记:第八章 特征提取
分布式系统设计策略
力扣(LeetCode)219. 存在重复元素 II(2022.08.07)
详细讲解修改allure报告自定义的logo和名称中文
EZVIZ and Xiaomi compete against smart cameras
【C语言】[编程题]倒置字符串
卫星互联网真能替代 5G?
测试开发专栏——序言:总结过去,展望未来
【访谈】Eotalk Vol.01:Eoapi,我们希望以开源的方式构建 API 生态系统
NoSQL的意思就是就是不使用SQL吗?
SQL 语言的详解 --- 最最基础的内容!!! 刚学完常复习
PWA 应用 Service Worker 缓存的一些可选策略和使用场景
关系数据库是怎么确定关系表中的数据的呢?
shell 创建LVM逻辑据卷
Oracle ASM disk group replaces old storage scheme with new storage
C# api 将base64编码 上传至fastdfs转成文件
In ASP.NET Core 2.0, solve the configuration problem of large file upload
Machine learning model too slow?Look at Intel (R) extension to accelerate
带你深入理解3.4.2的版本更新,对用户带来了什么?