枚举X509Store? [英] Enumerate X509Store?

查看:106
本文介绍了枚举X509Store?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有没有办法枚举 x509Store对象?


我想像这样访问MS-Keystore:

 store = new X509Store(StoreLocation。 CurrentUser); 

因此它应检测CurrentUser Location中的所有密钥库。这应该是默认的密钥库,如:AdressBook,AuthRoot,CertificateAuthority,Disallowed,My,Root,TrustedPeople,TrustedPublisher。


但在我的Keystore上,例如这些另外两个Keystores:exampleKeystore(我已创建)和Active Directory用户对象密钥库。我知道我可以像这样访问它们:

 store = new X509Store(" exampleKeystore",StoreLocation.CurrentUser); 

但我想列举这些,因为我可能不知道其他用户有哪个Keystore。所以我想要一个像这样的代码:

 foreach x509 store in store {print storeName} 


我找不到任何解决方案对于这个问题。希望有人能帮助我!


解决方案

http://msdn.microsoft.com /en-us/library/windows/desktop/aa380252(v=vs.85).aspx#certificate_store_functions


以上链接的枚举功能应该做你想要的 示例:

http: //msdn.microsoft.com/en-us/library/windows/desktop/aa382362(v=vs.85).aspx


Hi,

is there a way to enumerate the x509Store Object?

I want to access the MS-Keystore like this:

store = new X509Store(StoreLocation.CurrentUser);

So it should detect all keystore inside the CurrentUser Location. This should the default keystores like:AdressBook, AuthRoot, CertificateAuthority, Disallowed, My, Root, TrustedPeople, TrustedPublisher.

But on my Keystore for example are these two more Keystores: exampleKeystore (which i have created) and Active Directory User-Object Keystore. I know i can access them like this:

store = new X509Store("exampleKeystore", StoreLocation.CurrentUser);

But i want to enumerate these, because maybe i don't know which Keystore an other User has. So i want a Code like this:

foreach x509Store in store { print storeName }

I don't found any solution for this problem. Hope someone could help me!

解决方案

http://msdn.microsoft.com/en-us/library/windows/desktop/aa380252(v=vs.85).aspx#certificate_store_functions

The Enum functions at the above link should do what you want.  Example here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa382362(v=vs.85).aspx


这篇关于枚举X509Store?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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