Creating a self-signed code signing certificate for testing

suggest change

When signing personal scripts or when testing code signing it can be useful to create a self-signed code signing certificate.

Beginning with Windows PowerShell 5.0 (PKI module, Windows only), you can generate a self-signed code signing certificate with New-SelfSignedCertificate:

New-SelfSignedCertificate -FriendlyName "StackOverflow Example Code Signing" -CertStoreLocation Cert:\CurrentUser\My -Subject "SO User" -Type CodeSigningCert

In earlier versions, you can create a self-signed certificate using the makecert.exe tool found in the .NET Framework SDK and Windows SDK.

A self-signed certificate is trusted only by computers that have that certificate installed (typically in TrustedPublisher, and in Root if you also want to trust the issuer). For scripts that will be shared, use a certificate from a trusted certificate authority (internal or third-party).

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents