【问题标题】:How do you generate a CRL certificate file in Powershell?如何在 Powershell 中生成 CRL 证书文件?
【发布时间】:2018-04-02 01:01:30
【问题描述】:

使用makecert.exe,我可以获取一个 pvk 文件并使用以下命令生成一个 CRL:

makecert.exe -crl -n "CN=Foobar" -r -sv "Foobar.pvk" "Foobar.crl"

什么是等效的 Powershell 命令?

以下代码使用 Powershell 生成 PVK 和 CER 文件,但我不知道如何生成 CRL

$rootcert = New-SelfSignedCertificate -DnsName "CN=Foobar" -CertStoreLocation cert:\LocalMachine\My 
$PFXPass = ConvertTo-SecureString -String "my password" -Force -AsPlainText
Export-PfxCertificate -Cert $('cert:\LocalMachine\My\' + $rootcert.Thumbprint) -Password $PFXPass -FilePath "Foobar.pvk"
Export-Certificate -Cert $('cert:\LocalMachine\My\' + $rootcert.Thumbprint) -FilePath "Foobar.cer"

【问题讨论】:

  • 我认为没有任何用于生成或签署 CRL 的 cmdlet,我的建议是继续使用 makecert.exe 或尝试制定底层 API 并通过 PowerShell 调用它
  • 为什么需要不同的命令? makecert.exe 在 PowerShell 中工作。

标签: powershell certificate x509


【解决方案1】:

需要考虑的三件事:

  1. makecert.exe 工具已弃用,不再推荐使用:MakeCert
  2. 为自签名证书生成 CRL 是无用的,没有任何意义。自签名证书的吊销是未定义的,因为它会导致鸡蛋和鸡肉的问题。他们使用明确的信任。
  3. 手动 CRL 生成是一种不可维护的解决方案。您应该使用 CA 软件来运行您自己的 CA 并自动执行特定于 CA 的例程。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-31
    • 1970-01-01
    • 2018-12-30
    • 1970-01-01
    • 2019-01-11
    • 2012-04-11
    相关资源
    最近更新 更多