2

I need to install a Personal certificate for a Windows Service. So far I have been able to install certificate in CurrentUser and LocalMachine (in case of root certs), but I haven't been able to find if there is way to do this for a Windows Service store (for Message Queuing - MSMQ service). Here is what I have so far.

X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);

Any ideas? I have seen references to Web Service Enhancements having a method to open a service cert collection, but I am trying to figure out if System.Security.Cryptography has something equivalent.

This program is in C# targetting .NET 4.

1 Answer 1

0

I don't think that any of the .NET APIs allow access to the Services Certificate store.

However, you can install the certificate into the CurrentUser store of the account that the service runs under.

For machine accounts like NetworkService, you can run the certificate installing application under that account, in order to write to the store.

1
  • That's what I have found so far. Thanks for confirming.
    – thebitguru
    Mar 2, 2011 at 0:54

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.