Click here to Skip to main content
12,079,489 members (63,008 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi,

I am trying to add certificates into a certificate store for current logged in user. All these must be done under a service (run with LocalSystem account). The problem I faced is that (although debugged the service source code successfully) when I check the certificate store using MMC (Microsoft management console), none of my certificates could be found. I searched through all the instances of certificate stores (current user, current service and local machine).
I tested the part of code responsible for installing certificates into the intended store, using another normal Windows MFC test application and all the things worked OK!.

The important functions I used in my service are: CertAddcertificateContextToStore and CertOpenStore. I examined the various options for important 'dwFlags' parameter of 'CertOpenStore' function according MSDN, but in no case I did find the certificates. I even checked the MSDN referred paths in the registry, pertinent to certificate store locations.

Thanks
Posted 12-Jul-13 23:09pm
msisili111

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

A service shouldnt install certs. That should do some installer.

check the return codes of the api and install the certs with user creds.

Test some code which is executed with user or admin creds Blush | :O
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160212.1 | Last Updated 15 Jul 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100