如何将MakeCert命令转换为New-SelfSignedCertificate命令?

问题描述 投票:1回答:1

我正在遵循this tutorial为我的软件实施许可解决方案。

教程有时要求运行makecert命令:

makecert -pe -ss My -sr CurrentUser -$ commercial -n "CN=<YourCertName>" -sky Signature

但是这时makecert变得过时了,我尝试使其运行的所有解决方案在带有Visual Studio 2017的Windows 10上都失败了。不,开发人员命令提示符无济于事。不,安装Windows SDK没有帮助。

唯一严肃的解决方案似乎是接受makecert的过时并使用Powershell New-SelfSignedCertificate命令。

而且我可以创建此表:

enter image description here

但是我不确定这是正确的。您能否帮助我将此MakeCert命令转换为New-SelfSignedCertificate命令。

这是正确的吗?

New-SelfSignedCertificate -KeyExportPolicy Exportable -CertStoreLocation "Cert:\CurrentUser\My" -Type Custom -Subject "CN=<YourCertName>" -KeySpec Signature
powershell certificate makecert self-signed-certificate
1个回答
0
投票

您的命令对我来说很好,尽管我相信您会想使用Custom而不是CodeSigningCert类型。我确实要注意,由于主题参数是自动的,因此您不必指定CN=

要回答您的第二个问题,主题应该是证书所保护的名称。通常是访问资源的方式(例如服务器名称)。对于代码签名证书,通常将使用您的组织名称或某些变体。

© www.soinside.com 2019 - 2024. All rights reserved.