Marc Rufer 25 Nov 2015 PowerShell SuisseID
At d-fens, the company I’m working for, we all have a SuisseID, which can be used for different purposes like authentication and electronical signing purposes. It’s as well possible to sign code with the SuisseID. The advantages of using the SuisseID for code signing are that the SuisseID is a very cheap in comparison to other code signing certificates and that the user gets authenticated personally. The following section describes the necessary step to sign a PowerShell script on Windows by using your SuisseID.
To sign code with your SuisseId using PowerShell your SuisseId has to be installed on your computer and as well has to be connected with your computer.
mmc.exe
)Ctrl + m
Certificates
to the Selected snap-ins
My User Account
Personal\Certificates
Qualified Signature
certificate (Issued by SwissSign Qualified Platinum CA 2010 - G2
)General
tab select the radio button Enable only the following purposes
Get your code signing certificate by executing the following command
$cert = Get-ChildItem cert:\CurrentUser\my -CodeSigningCert
Sign PowerShell script file by executing the following command
Set-AuthenticodeSignature -FilePath C:\PathToTheFile\SomeFile.ps1 -Certificate $cert