0

I'm trying to sign my Appxbundle with a self signed Certificate via signTool from a secondary machine(VM), which gets me this error. It works from the machine where I created the self signed Certificate, only on other machine it gets me this error. And yes my Certificate is Valid. I also tried everything as suggested in Signtool error: No certificates were found that...

SignTool Error: No certificates were found that met all the given criteria.

I created a self signed Certificate via Powershell

New-SelfSignedCertificate -Subject "CN=somthing" -DnsName "www.something.com" -Type CodeSigning -CertStoreLocation Cert:\Currentuser\My -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable -NotAfter (Get-Date).AddYears(3)

then I exported it to my Desktop

Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0] -FilePath C:\Users\user\Desktop\folder\mycert.crt

After creating the Appxbundle I'm signing it via signTool

.\signtool.exe sign /a /v /fd SHA256 /f C:\Users\user\Desktop\folder\mycert.crt C:\Users\user\Desktop\folder\myapp.appxbundle

with /Debug it was clear that my Private Key was missing on the other Machines, which made sense... But I can't find the private key somehow as above shown I didn't create one. I tried to export my Certificate as PFX with private key but that was not Possible as it wasn't even an option in the export options.

It's important that I can do that on different Machines/VM's. Any idea what I can do?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
nani
  • 183
  • 2
  • 15
  • 2
    You created the privatekey, on the source machine only, and didn't export it. Use [Export-**Pfx**Certificate](https://learn.microsoft.com/en-us/powershell/module/pkiclient/export-pfxcertificate?view=win10-ps) – dave_thompson_085 Feb 04 '20 at 21:33
  • Ok now i am getting "Export-PfxCertificate : Cannot export non-exportable private key" – nani Feb 04 '20 at 21:46

0 Answers0