Bas*_*mme 5 powershell certificate makecert self-signed-certificate
我正在按照本教程为我的软件实施许可解决方案。
在某些时候,教程要求运行 makecert 命令:
makecert -pe -ss My -sr CurrentUser -$ commercial -n "CN=<YourCertName>" -sky Signature
Run Code Online (Sandbox Code Playgroud)
但此时 makecert 已过时,我尝试使其工作的所有解决方案在带有 Visual Studio 2017 的 Windows 10 上都失败了。不,开发人员命令提示符没有帮助。不,安装 Windows SDK 没有帮助。
唯一严肃的解决方案似乎是接受过时的 makecert 并使用 Powershell New-SelfSignedCertificate 命令。
我可以创建这个表:
但我不确定这是否正确。您能帮我将此 MakeCert 命令翻译为 New-SelfSignedCertificate 命令吗?
它是否正确?
New-SelfSignedCertificate -KeyExportPolicy Exportable -CertStoreLocation "Cert:\CurrentUser\My" -Type Custom -Subject "CN=<YourCertName>" -KeySpec Signature
Run Code Online (Sandbox Code Playgroud)
你的命令对我来说看起来不错,尽管Custom我相信你会想要使用CodeSigningCert. 我确实想指出,您不必CN=在主题参数中指定,因为它是自动的。
要回答你的第二个问题,主题应该是受证书保护的任何内容的名称。通常是访问资源的方式(例如服务器名称)。对于代码签名证书,通常会使用您的组织名称或某些变体。