【发布时间】: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