通过签署 CSR 创建 x509 v3 用户证书 [英] Creating an x509 v3 user certificate by signing CSR

查看:52
本文介绍了通过签署 CSR 创建 x509 v3 用户证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用 openssl 签署 CSR,但结果证书是 x509 v1,而不是 v3.

I know how to sign a CSR using openssl, but the result certificate is an x509 v1, and not v3.

我正在使用以下命令:

x509 -req -days 365 -in myCSR.csr -CA myCA.crt -CAkey myCA.key -CAcreateserial -out userCertificate.crt

我已经搜索过,但没有找到解决方案.有没有另一种方式以编程方式执行此操作?

I've searched but have not been able to find a solution. Is there another way to do this programmatically?

推荐答案

您需要指定一个扩展文件.

You need to specify an extensions file.

例如:

openssl x509 -days 365 -in myCSR.csr -extfile v3.ext -CA myCA.crt -CAkey myCA.key -CAcreateserial -out userCertificate.crt

扩展文件 (v3.ext) 可能如下所示:

The extensions file (v3.ext) can look like this:

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment

这篇关于通过签署 CSR 创建 x509 v3 用户证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆