2

System.IO.FileNotFoundException: CertEnroll::CX509PrivateKey::Create: The system cannot find the file specified. 0x80070002 (WIN32: 2)

The error above is the exception thrown when I attempt to create a private key to generate a CSR using the CX509PrivateKeyClass class from CertEnroll.dll.

It only seems to happen when I attempt to execute code deployed on a windows 2008 server.

It runs fine under windows 7.

Micho
  • 3,929
  • 13
  • 37
  • 40
sean
  • 11,164
  • 8
  • 48
  • 56
  • Did you find a solution for this? I am having the exact same problem... – Osvier Nov 07 '15 at 01:17
  • Related posts - For on-premise deployement : [CryptographicException was unhandled: System cannot find the specified file](https://stackoverflow.com/q/17840825/465053). For Azure deployment : [Certenroll on Azure - Generating self signed certificates](https://stackoverflow.com/q/58800004/465053) – RBT Nov 21 '21 at 08:00

1 Answers1

1

This is because you don't have proper permission to call the COM. I'm not sure the lowest permission but local administrator should work.

Shaun Xu
  • 4,476
  • 2
  • 27
  • 41