Codesigning on Windows

Does anyone know how to add the certificate to the CurrentUser store? I’m able to manually codesign using the LocalMachine store, however 3rd party packaging apps seem to expect the certificate to be in the CurrentUser store.

command run in CI:

Import-PfxCertificate -FilePath MyCert.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $Password

Output:

Import-PfxCertificate : Access denied. (Exception from HRESULT: 0x80090010)
At C:\Users\travis\build\saleae\monorepo\packages\electron\scripts\install_cert_windows.ps1:4 char:1

  • Import-PfxCertificate -FilePath MyCert.pfx -CertStoreLocation Cert:\ …
  • `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:slight_smile: [Import-PfxCertificate], COMException
  • FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.CertificateServices.Commands.Impor
    tPfxCertificate