如何使用CertFindCertificateInStore在Store中提取两个或两个以上符合搜索条件的证书?

yeahchang 2003-11-15 09:58:46
如何使用CertFindCertificateInStore在Store中提取两个或两个以上符合搜索条件的证书?
我从MSDN上知道:CertFindCertificateInStore can find the first, or next, certificate context in the certificate store that meets a search criterion.
但我不知道该如何实现,我觉的应该是和pPrevCertContext有关。
从资料上看:pPrevCertContext
[in] Pointer to the last CERT_CONTEXT structure returned by this function. This parameter must be NULL on the first call of the function. A pPrevCertContext parameter that is not NULL is always freed by this function, even if the function causes an error.
如果能,也只能找出第一个和最后一个!

还望哪位大哥告知应如何实现。

真迷茫……
...全文
183 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yeahchang 2004-01-20
  • 打赏
  • 举报
回复
我会了。
谁来接个分呀(我会将此贴转到非技术区)。
Invisual 2004-01-20
  • 打赏
  • 举报
回复
我来接分,呵呵。能否说说是怎么解决的?
yeahchang 2004-01-20
  • 打赏
  • 举报
回复
up
yeahchang 2003-11-27
  • 打赏
  • 举报
回复
我自己解决了,请大家看另一个问题:

那CertFreeCertificateContext(pCertContext);放哪里?
是:
while(...)
{
...
CertFreeCertificateContext(pCertContext);
}

还是:
while(...)
{
...
}
CertFreeCertificateContext(pCertContext);

感觉第一种好像不太对!还望指点一二!

551

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 茶馆
社区管理员
  • 茶馆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧