我写了一个需要证书签名和其他一些东西的程序。
我已经将我的pfx文件作为私有证书上传到我的应用服务的SSL证书中。 然后我尝试查看已安装证书的应用程序服务,如此处所述,使用PowerShell。 但我的当前用户没有任何证书。
我也检查了我的本地计算机,但它也不在那里。
我也无法使用我的C#代码找到它:
我已经将我的pfx文件作为私有证书上传到我的应用服务的SSL证书中。 然后我尝试查看已安装证书的应用程序服务,如此处所述,使用PowerShell。 但我的当前用户没有任何证书。
我也检查了我的本地计算机,但它也不在那里。
![enter image description here](https://istack.dev59.com/kj5w6.webp)
X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindByThumbprint, ThumbPrint, false);
if (certCollection.Count == 0)
throw new Exception("Certificate not found");