在Windows服务下进行安装时,我的用户证书的安装位置 [英] Where my user certificates are installed when doing it under a windows service

查看:197
本文介绍了在Windows服务下进行安装时,我的用户证书的安装位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试将当前登录用户的证书添加到证书存储中.所有这些都必须在服务下运行(使用LocalSystem帐户运行).我遇到的问题是(尽管已成功调试了服务源代码)当我使用MMC(Microsoft管理控制台)检查证书存储时,找不到我的证书.我搜索了证书存储的所有实例(当前用户,当前服务和本地计算机).
我使用另一个普通的Windows MFC测试应用程序测试了负责将证书安装到预期存储中的代码部分,一切正常!!

我在服务中使用的重要功能是:CertAddcertificateContextToStore和CertOpenStore.我根据MSDN检查了"CertOpenStore"功能的重要''dwFlags''参数的各种选项,但在任何情况下都没有找到证书.我什至检查了注册表中与证书存储位置有关的MSDN引用路径.

谢谢

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

推荐答案

服务不应该安装证书.那应该做一些安装程序.

检查api的返回码,并使用用户凭据安装证书.

测试一些使用用户或管理员凭据执行的代码:-O
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 :-O


这篇关于在Windows服务下进行安装时,我的用户证书的安装位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆