【问题标题】:Private key from Certificate generated with certreq is not exportable使用 certreq 生成的证书中的私钥不可导出
【发布时间】:2022-01-25 16:18:36
【问题描述】:

我创建了一个带有 inf 文件和 certreq 的证书,其设置如下:

   $InfFile = @"
    [NewRequest]`r
    FriendlyName = $FQDN
    Subject = "CN=$FQDN,OU=$OrganizationalUnit,O=$Organisation,L=$Locality,S=$State,C=$CountryName,E=$Email"`r
    KeySpec = 1
    KeyLength = 2048
    Exportable = TRUE`r
    RequestType = PKCS10`r

    [Extensions]
    2.5.29.17 = "{text}"
    _continue_ = "DNS=$FQDN&"
    _continue_ = "DNS=$SERVERNAME"
"@

如果我在脚本中运行它,将创建证书。但是,即使我将“Exportable”的值设置为 true,我也无法导出私钥。如图所示,似乎没有与证书关联的密钥:

Certificate without key

这里有一个带有关联密钥的证书供参考:

Certificate with Key

我不太确定我做错了什么,有什么想法吗?

干杯 野牛战士

【问题讨论】:

  • 刚刚找到了我自己问题的答案。我必须在 inf 文件中添加以下内容: MachineKeySet = TRUE
  • 你可以把它写成答案并接受它。

标签: certificate private-key certreq


【解决方案1】:

刚刚找到我自己问题的答案。我必须将以下内容添加到 inf 文件中:MachineKeySet = TRUE

【讨论】:

    猜你喜欢
    • 2017-10-05
    • 2017-05-07
    • 2020-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-16
    相关资源
    最近更新 更多