VS2017 code signing (performed by a Cordova Windows build) expects the code signing certificate in Cert:\CurrentUser\My
. Running this on a local machine works without problems, but on the Travis Windows environment it seems to be impossible because I cannot add the certificate to Cert:\CurrentUser\My
.
I’ve tried adding the certificate in Travis with both certutil:
certutil -user -p mypassword -importpfx mycertificate.pfx
and with a powershell script:
Import-PfxCertificate -FilePath $Pfxpath -CertStoreLocation Cert:\CurrentUser\My -Password $Password
but both methods fail. It is possible to add the certificate to Cert:\LocalMachine\My
but then VS2017 does not pick up the certificate and ends with a couple error messages.
warning APPX0105: Cannot import the key file 'mycertificate.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user's person al certificate store.
warning APPX0102: A certificate with thumbprint '1234567890123456789012345678901234567890' that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file.
warning APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478
Is there a way to fix this problem?