1 Reply Latest reply on Mar 19, 2017 12:43 PM by rickyb39117700

    Windows 10 build fails with notice "The certificate specified is not valid for signing..." for self signed certificate

    John.Pereira

      My APP ID is 2490616

      I use build.phonegap.com to create my builds

      I've signed up for an individual MS developer account, paid and verified the account

       

      I've followed the instructions on the blog to setup my config.xml and create a self signed certificate. I've added the following to my config.

       

      <author>John Pereira</author>
      <platform name="windows" />
      <preference name="windows-identity-name" value="<ID_FROM_MS_DEV_ACCOUNT>" />
      <preference name="windows-arch" value="x64" />
      <preference name="windows-appx-target" value="uap" />
      
      

       

      I created a self signed certificate with the following commands

       

       

      New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=69EA6098-29B4-4D48-AA3E-D39B242A0FC0" -KeyUsage DigitalSignature -FriendlyName "John Pereira" -CertStoreLocation "Cert:\LocalMachine\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3")
      
      $pwd = ConvertTo-SecureString -String "<password>" -Force -AsPlainText
      
      Export-PfxCertificate -cert "Cert:\LocalMachine\My\<COPIED_THUMBPRINT_ID_HERE>" -FilePath d:\webroot\winkey.pfx -Password $pwd
      

       

      I then uploaded the created PFX file to the build dashboard on PhoneGap Build and carried out a build using the uploaded key. It's currently in error status (log attached below)

       

      The error I'm receiving is : error APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478.

       

      As far as I can gather I haven't missed out in any steps needed to create win10 app. If I run the build without a key, an APPX file is created but cannot be installed because the certificate is not trusted.

       

      Let me know if any other information is required. Following is the log from the build.

       

      Build Date: 2017-02-28 11:08:49 +0000
      ================ Certificate 0 ================
      ================ Begin Nesting Level 1 ================
      Element 0:
      [ Mod: Serial number removed ]
      Issuer: CN=69EA6098-29B4-4D48-AA3E-D39B242A0FC0
       NotBefore: 2/28/2017 10:52 AM
       NotAfter: 2/28/2018 11:12 AM
      Subject: CN=69EA6098-29B4-4D48-AA3E-D39B242A0FC0
      Signature matches Public Key
      Root Certificate: Subject matches Issuer
      Cert Hash(sha1): 12 ad 31 99 9f 0b 8f 5c 2f 89 43 c4 e4 6b 96 18 53 8a da af
      ---------------- End Nesting Level 1 ----------------
        Provider = Microsoft Software Key Storage Provider
      Private key is NOT plain text exportable
      Encryption test passed
      CertUtil: -dump command completed successfully.
      --------------------------------------------------------------------------------
      PLUGIN OUTPUT
      --------------------------------------------------------------------------------
      Fetching plugin "cordova-plugin-camera@2.3.1" via npm
      Installing "cordova-plugin-camera" at "2.3.1" for windows
      Fetching plugin "cordova-plugin-compat" via npm
      Installing "cordova-plugin-compat" at "1.1.0" for windows
      Fetching plugin "cordova-plugin-geolocation@2.4.1" via npm
      Installing "cordova-plugin-geolocation" at "2.4.1" for windows
      Dependent plugin "cordova-plugin-compat" already installed on windows.
      Fetching plugin "cordova-plugin-inappbrowser@1.6.1" via npm
      Installing "cordova-plugin-inappbrowser" at "1.6.1" for windows
      Fetching plugin "cordova-plugin-network-information@1.3.1" via npm
      Installing "cordova-plugin-network-information" at "1.3.1" for windows
      Fetching plugin "cordova-plugin-request-location-accuracy@2.2.0" via npm
      Installing "cordova-plugin-request-location-accuracy" at "2.2.0" for windows
      Fetching plugin "cordova-plugin-splashscreen@4.0.1" via npm
      Installing "cordova-plugin-splashscreen" at "4.0.1" for windows
      Fetching plugin "cordova-plugin-whitelist@1.2.2" via npm
      Installing "cordova-plugin-whitelist" at "1.2.2" for windows
      Fetching plugin "cordova-plugin-x-socialsharing@5.1.6" via npm
      Installing "cordova-plugin-x-socialsharing" at "5.1.6" for windows
      Fetching plugin "pushwoosh-cordova-plugin@6.5.0" via npm
      Installing "pushwoosh-cordova-plugin" at "6.5.0" for windows
      Certificate "John Pereira" added to store.
      
      CertUtil: -importPFX command completed successfully.
      My "Personal"
      Deleting Certificate 1: CN=69EA6098-29B4-4D48-AA3E-D39B242A0FC0:12ad31999f0b8f5c2f8943c4e46b9618538adaaf
      CertUtil: -delstore command completed successfully.
      Building project: C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj
      Configuration : release
      Platform : x64
        Patching 10 in prebuild event...
        Injected base.js reference to the www/index.html
        Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from www/index.html
        Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from www/index.html
      MakePRI : warning 0xdef00520: Invalid qualifier: YOU-PORTRAIT [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
      MakePRI : warning 0xdef00520: Invalid qualifier: YOU-WIDE [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
      C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1854,5): warning APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
        Starting .NET Native compilation
        C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /pdb:C:\cygwin\tmp\gimlet\2490616\project\build\windows\bld\ilc\intermediate\44268JohnPereira.IWDev.pdb /nostdlib+ /reference:"C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\lib\Private\System.Private.CoreLib.dll" /debug:full /out:C:\cygwin\tmp\gimlet\2490616\project\build\windows\bld\ilc\intermediate\44268JohnPereira.IWDev.exe /target:winexe C:\cygwin\tmp\gimlet\2490616\project\build\windows\bld\ilc\intermediate\fake.cs
        Processing application code
      C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(885,5): warning : Your application is missing a Runtime Directives (rd.xml) file. Runtime Directives are used to describe the dynamic behavior of your application and control the .NET Native optimizer. It is recommended to have at least one rd.xml file in your project. [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
       Resources.System.Linq.Expressions.rd.xml(35): warning : Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found. [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
       Resources.System.Linq.Expressions.rd.xml(91): warning : Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found. [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
        Computing application closure and generating interop code
        Generating serialization code
        Compiling interop code
        Cleaning up unreferenced code
        Generating native code
        Generating fixups for native code
        CordovaApp.Windows10 -> C:\cygwin\tmp\gimlet\2490616\project\AppPackages\CordovaApp.Windows10_1.0.0.0_x64_Test\CordovaApp.Windows10_1.0.0.0_x64.appx
      C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2465,5): error APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\cygwin\tmp\gimlet\2490616\project\CordovaApp.Windows10.jsproj]
      

       

      Message was edited by: John Pereira I received two email notices saying my content was approved then I see the content has been rejected and I need to make changes. Not sure what the changes I need to make are so resubmitting with minor changes.

       

      [ Mod: Rejecting based on the fact it supplies a serial number.. ]