如何从PCCERT_CONTEXT获取CSP的Provider名称?
我一直在尝试从 PCCERT_CONTEXT 获取提供程序名称,因为在我当前的项目中,我必须将智能卡中的所有证书加载到我的程序中。将来我必须通过更新证书、删除证书等任务来处理这些证书。但我有问题,我必须将 CSP 名称和提供程序名称与 CryptAcquireContext 映射到执行程序。我目前很困惑如何存档这个问题,任何人都可以提供一些指南来帮助我解决这个问题。 我尝试使用 dwPropId 的 CertGetCertificateContextProperty 为 CERT_KEY_PROV_INFO_PROP_ID,但我无法获取 CRYPT_KEY_PROV_INFO。
I have been try to get a provider name from PCCERT_CONTEXT because in my current project i must have load all certificate from smart card into my program. And in the future I have to deal with those certificate with some task like renewal certificate, delete certificate. But I have problem, I must to map CSP name and provider name with CryptAcquireContext to executive. And I currently confused how to archive this, can anyone have some guide to help me resolve this problem.
I have try CertGetCertificateContextProperty with dwPropId is CERT_KEY_PROV_INFO_PROP_ID but i can not get CRYPT_KEY_PROV_INFO.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没理解错的话,下面的代码片段展示了如何从证书中提取密钥提供程序信息。
If I have understood you correctly, the following snippet shows how to extract the key provider information from a certificate.