forked from dokan-dev/dokany
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.ps1
16 lines (14 loc) · 1009 Bytes
/
sign.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This powershell script need CERTISSUER, ADDITIONALCERT and EV_CERTISSUER env variable set
# CERTISSUER - Certificat issuer name
# ADDITIONALCERT - Your certificat path
# EV_CERTISSUER - Certificat issuer name for EV sign
New-Item -ItemType Directory -Force -Path Win32,x64,ARM | Out-Null
$files = Get-ChildItem -path Win32,x64,ARM -recurse -Include *.sys,*.cat,*.dll,*.exe
signtool sign /v /i "$env:CERTISSUER" /ac "$env:ADDITIONALCERT" /t http://timestamp.verisign.com/scripts/timstamp.dll $files
signtool sign /as /fd SHA256 /v /i "$env:CERTISSUER" /ac "$env:ADDITIONALCERT" /tr http://timestamp.globalsign.com/?signature=sha2 /td SHA256 $files
if (-not ([string]::IsNullOrEmpty($env:EV_CERTISSUER)))
{
New-Item -ItemType Directory -Force -Path Win32\Win10Release,x64\Win10Release | Out-Null
$files = Get-ChildItem -path Win32\Win10Release,x64\Win10Release -recurse -Include *.sys,*.cat,*.dll
signtool sign /as /fd sha256 /tr http://timestamp.digicert.com /td sha256 /n "$env:EV_CERTISSUER" $files
}