我编写了一个程序,需要签名证书和其他一些东西。
我已将我的pfx文件作为私人证书上传到我的应用服务的SSL证书中。
然后我尝试在我的应用服务上看到已安装的证书,因为已经使用power shell描述了in here。
但我现在的用户没有任何证书。
我也不能使用我的c#代码找到它:
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");
答案 0 :(得分:6)
答案 1 :(得分:2)
我们可以从blog获得答案。
添加名为 WEBSITE_LOAD_CERTIFICATES 的应用设置,并将其值设置为证书的指纹,这样您的网络应用就可以访问它了。
您可以多个逗号分隔指纹值或可以将此值设置为“*”(不带引号),在这种情况下全部您的证书将加载到您的Web应用程序个人证书存储区。