蛋糕店筹备中 2023-04-04 14:36 采纳率: 50%
浏览 13
已结题

如何用openssl命令创建csr文件时添加attributes

如何用openssl命令创建csr文件时添加attributes?
openssl req -ecdsa-with-SHA1 -new -key a.pem -subj "/DC=a" -out a.csr
如下:
无attributes

img

有attributes

img

  • 写回答

2条回答 默认 最新

  • centreon~ 2023-04-04 19:05
    关注

    要在使用 openssl 命令创建 CSR 文件时添加 attributes,你可以向命令行选项中添加 -reqexts 和 -config 参数,并在 OpenSSL 配置文件中指定自定义的 attributes 配置。具体步骤如下:

    1. 创建一个 OpenSSL 配置文件(例如 openssl.cnf),并在文件中添加如下内容:
      [req_attributes]
      challengePassword = A challenge password
      unstructuredName = An optional company name
      这里的 challengePassword 和 unstructuredName 是 examples,您可以根据需要指定其他自定义属性。
    2. 执行以下 openssl 命令,向其添加 -config 和 -reqexts 选项:
      openssl req -ecdsa-with-SHA1 -new -key a.pem -subj "/DC=a" -out a.csr -config openssl.cnf -reqexts req_attributes
      这将使用指定的 OpenSSL 配置文件和 req_attributes 扩展来创建 CSR 文件,并在其中包含你指定的自定义 attributes。
      以上是使用 OpenSSL 命令添加 attributes 的步骤。需要注意的是,这只是其中的一种方法,具体实现方式可能因 OpenSSL 版本和配置而有所不同。
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月21日
  • 已采纳回答 4月13日
  • 修改了问题 4月4日
  • 创建了问题 4月4日

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程