Last active
August 6, 2024 07:45
-
-
Save crazyoptimist/23f4acf6fe183538436d2c5c0b4ba064 to your computer and use it in GitHub Desktop.
Generate a self-signed certificate and sign your windows binaries with it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Credits: https://www.the-automator.com/ | |
; Create certificate | |
$cert = New-SelfSignedCertificate -Subject "{CertName}" -CertStoreLocation "cert:\CurrentUser\My" -HashAlgorithm sha256 -type CodeSigning | |
; Create password | |
$pwd = ConvertTo-SecureString -String "{123456}" -Force -AsPlainText | |
; Export Certificate to a file | |
Export-PfxCertificate -cert $cert -FilePath {CertName}.pfx -Password $pwd | |
; Sign the executable | |
signtool.exe sign /f {CertName}.pfx /fd sha256 /p 123456 {Program}.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment