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?