1、双证书签发
-
先自己生成一个自签名证书代替根证
1、openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:sm2 -out rootCA.key #使用sm2生成私钥 2、openssl req -new -sm3 -key rootCA.key -out rootCA.req -sigopt "distid:1234567812345678" #创建证书请求 3、openssl x509 -req -days 365 -sm3 -in rootCA.req -signkey rootCA.key -out rootCA.pem -vfyopt "distid:1234567812345678" -extfile v3.ext #生成证书 有两种方式实现扩展信息添加: 1、利用配置文件及section: -extfile openssl.cnf -extensions v3_ca 2、编写额外的扩展文件: -extfile v3.ext(文件中不用加[]头)
//自签名根证书 [ v3_ca ] subjectKeyIdentifier=hash authorityKeyIdentifier=keyid:always,issuer basicConstraints = critical,CA:true keyUsage = cRLSign, keyCertSign
//暂时不用 [ v3_req ] basicConstraints = CA:FALSE keyUsage = nonRepud