How can I enroll certificate while no user logged in?

0

I use this link to Enrol new Certificate.

When the Windows is lock or logged in everything works fine and create request and install it properly.

Running the code as Windows Service, so when I restart the machine, and service is starting cannot create request and get the error the following line:

objPrivateKey.Create();

And the error is:

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

Any idea how can I fix this issue? Thanks

c#
certenroll
asked on Stack Overflow Dec 13, 2019 by Peyman • edited Dec 13, 2019 by Hadi Samadzad

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0