none
Sign($cert,$package) function reporting "Root element is missing!" exception... RRS feed

  • Question

  • Hello,

    I'm using HCK API's Sign($certObj, $packagepath) function in scripts to sign the packages. This function sometimes signs the package with no error/exception, but sometimes generates the following exception [obviosuly does not sign then]:

    "Root element is missing!"

    When this exception is reported, I have observed that the size of the package is being reduced by some 200-400 kb's.

    I have verified the certificate object and Package path string, both are correct.

    I don't know whats going wrong with Sign function, what's causing this exception and why the package size is being reduced?

    Please help me out with this.

    Thanks & regards,

    Nilesh

    Tuesday, February 19, 2013 11:52 AM

All replies

  • No one?

    Not even MSFT people?

    Tuesday, February 26, 2013 5:38 AM
  • Is there a stack trace in the Windows Event Viewer that you could provide?


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

    Friday, March 8, 2013 4:48 PM
  • After digging around some more, I think there might be an issue with signing large packages using PowerShell. Can you confirm that the times that signing fails, those packages tend to be larger than the packages when signing succeeds?

    If that is the case, there are a couple of options to look at -

    1. Sign using HCK Studio

    2. Write a small C# app to sign. Something like -

                X509Certificate cert = new X509Certificate(pfx cert file, password);
                PackageManager.Sign(packageFile, cert);

     

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


    Friday, March 8, 2013 5:25 PM
  • Hi,

    Sorry for replying so late.

    The packages I generally sign are of size around 30-40 Mbs, when signing succeeds package size increases by 2-3 Mbs. But when signing failes with an exception i have mentioned, package size is reduced by 300-400 kbs, where package size is supposed to remain same as original.

    If this is fault of PowerShell, I'll try it in C#.

    Thanks,

    Nilesh.

    Monday, April 1, 2013 7:36 AM