I'm following this tutorial to implement a licensing solution to my software.
At some point the tutorial ask to run a makecert command:
makecert -pe -ss My -sr CurrentUser -$ commercial -n "CN=<YourCertName>" -sky Signature
But at this time makecert became obsolete and all the solution I tried to make it work fails on my Windows 10 with Visual Studio 2017. No, the developer Command Prompt don't help. No, installing Windows SDK don't help.
The only serious solution seems to accept the obsolecense of makecert and use the Powershell New-SelfSignedCertificate command.
- I went on MakeCert documentation
- I went on New-SelfSignedCertificate documentation
And I could create this table:
But i'm not sure this is correct. Could you please help me to translate this MakeCert command to New-SelfSignedCertificate command.
Is this correct?
New-SelfSignedCertificate -KeyExportPolicy Exportable -CertStoreLocation "Cert:\CurrentUser\My" -Type Custom -Subject "CN=<YourCertName>" -KeySpec Signature

Your command looks good to me, though instead of a
Customtype I believe you'll want to useCodeSigningCert. I do want to note that you don't have to specifyCN=in the subject parameter as it's automatic.To answer your second question, the subject should be the name of whatever is protected by the certificate. It's normally how the resource is accessed (e.g. server name). For a code signing certificate, typically your organization name, or some variant, would be used.