none
HCK Sign submission package using Object Model RRS feed

  • Question

  • 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?

    Monday, December 16, 2013 11:04 PM

Answers

  • How did you check if it was signed? When signing a package, we put the signature internal to the package. It's not a external signature (i.e. right-click | properties | security).

    If you want to see if it is signed, you can add a ".zip" extension to the file and look if there is a ".\packages\services\digital-signature folder"


    John -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by hh-hh-hh Monday, December 16, 2013 11:44 PM
    Monday, December 16, 2013 11:10 PM

All replies

  • How did you check if it was signed? When signing a package, we put the signature internal to the package. It's not a external signature (i.e. right-click | properties | security).

    If you want to see if it is signed, you can add a ".zip" extension to the file and look if there is a ".\packages\services\digital-signature folder"


    John -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by hh-hh-hh Monday, December 16, 2013 11:44 PM
    Monday, December 16, 2013 11:10 PM
  • John,

    Thanks!  It was there.  I had been using the right-click -> properties method, and now understand that it is not an external signature.  (Didn't know there was such thing as an internal and external signature : )

    Monday, December 16, 2013 11:43 PM