Hello,
To sign submission packages, I used the sample code in the HCK documentation:
Function signSubmissionPackage
{
Param(
[Parameter(Mandatory=$true)]
[string]$packageFile,
[Parameter(Mandatory = $true)]
[string]$pfx_file,
[Parameter(Mandatory=$true)]
[string]$pfx_password
)
# Load DLLs.
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "Microsoft.Windows.Kits.Hardware.objectmodel.dll")
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "Microsoft.Windows.Kits.Hardware.objectmodel.submission.dll")
#Write-Host "Usage: %SystemRoot%\SysWOW64\WindowsPowershell\v1.0\powershell.exe -file sign_package.ps1 <<Full Path To Package>> <<Full Path to PFX>>"
$sec_pfx_password = ConvertTo-SecureString -AsPlainText $pfx_password -Force
# Load the certificate.
$cert = new-object -typename System.Security.Cryptography.X509Certificates.X509Certificate($pfx_file, $sec_pfx_password)
# sign $packageFile
[Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.PackageManager]::Sign($packageFile, $cert)
}
Tried calling this function in a PowerShell window. It returned no error and the package was not signed, at least as far as I can tell. What might I be doing wrong?