How to create the code signing certificate through the New-SelfSignedCertificate cmdlet

The version of New-SelfSignedCertificate on PS 4 is rather basic.

However Powershell v5 has the parameters that you would require to create specific keys.

Specifically a Keyusage parameter that takes

-- CertSign
-- CRLSign
-- DataEncipherment
-- DecipherOnly
-- DigitalSiganture
-- EncipherOnly
-- KeyAgreement
-- KeyEncipherment
-- None (default) 
-- NonRepudiation

and a KeyUsageProperty taking

-- All
-- Decrypt
-- KeyAgreement
-- None (default) 
-- Sign

Are you specifically tied to v4? If you can upgrade to v5 you should be able to achieve what you need.

Tags:

Powershell