gpt4 book ai didi

c# - 从 C# 中的证书存储中获取证书列表

转载 作者:IT王子 更新时间:2023-10-29 04:01:55 27 4
gpt4 key购买 nike

对于安全应用程序,我需要在对话框中选择一个证书。如何使用 C# 访问证书存储区或其一部分(例如 storeLocation="Local Machine"storeName="My")并从中获取所有证书的集合那里?预先感谢您的帮助。

最佳答案

X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);

store.Open(OpenFlags.ReadOnly);

foreach (X509Certificate2 certificate in store.Certificates){
//TODO's
}

关于c# - 从 C# 中的证书存储中获取证书列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1205295/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com