如何从根存储中获取证书颁发者? [英] How to get the certificate issuer from the root store?

查看:315
本文介绍了如何从根存储中获取证书颁发者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户正在使用CAPI证书。在根存储中,有多个来自同一CA(颁发者)的证书,所有证书都具有相同的公钥和"主题密钥标识符",但它们具有不同的有效时间和序列
编号。


尝试使用函数  CertGetIssuerCertificateFromStore但它返回了错误的Issuer证书。


我怎样才能从根商店获得正确的发行人证书?

解决方案

Hello Hamutal1,


来自
文档
"CertGetIssuerCertificateFromStore函数从证书存储中检索证书上下文
指定主题证书的第一个或下一个发行者。"


因此,它检索证书具有相同主题但可能具有不同的发行人。


如果您想获得相同的颁发者证书,也许这是一种解决方法,您可以使用  CertEnumCertificatesInStore 并使用  CertCompareCertificateName
检查证书是否与您预期的名称相同。



如果有帮助请告诉我。



祝你好运,


Rita


A user is using a CAPI certificate. In the root store there are number of certificates from the same CA (issuer), all of them with the same public key and "subject key identifier" but they have different validity time and serial number.

Tried to use the function CertGetIssuerCertificateFromStore but it returned the wrong Issuer certificate.

How can i get the right issuer certificate from the root store?

解决方案

Hello Hamutal1,

From the document that "The CertGetIssuerCertificateFromStore function retrieves the certificate context from the certificate store for the first or next issuer of the specified subject certificate."

So it retrieve certificates have same subject but may have different issuer.

If you want to get same issuer certificate, maybe this is a workaround, you can use CertEnumCertificatesInStore in a loop and use CertCompareCertificateName to check if a certificate has the same name you expected.

Please let me know if it helps.

Best regards,

Rita


这篇关于如何从根存储中获取证书颁发者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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