无法读取X509Certificate2私钥 [英] Unable to read the X509Certificate2 private key

查看:181
本文介绍了无法读取X509Certificate2私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用X509Certificate2 [PFX],我从Microsoft Azure AppService [非Web角色]中的My / CurrentUser存储中读取此证书。如果应用程序在空闲超时后尝试重新启动,似乎证书丢失了
其私钥,我无法解密消息。

I am using an X509Certificate2 [PFX] and I am getting this certificate read from the My / CurrentUser Store in Microsoft Azure AppService [Not Web Role]. In case of the application trying to restart after a idle timeout, it seems that the certificate looses its private key and I am not able to decrypt the messages.

有没有除了上传证书之外,还要在Azure AppService中进行特定更改,以确保证书的私钥在内部可读。

Is there any specific change to be done in the Azure AppService other than uploading the certificate to make sure that the certificate's Private key is readable internally.

甚至尝试使用私有blob进行此操作并获得" ;未找到密钥集"证书商店和证书商店中的例外情况BLOB存储。 

Even tried to use a private blob for this and got the "Key Set Not Found" exception in both the Certificate Store & the BLOB Storage. 

我不确定为什么私钥会突然丢失,为什么会抛出异常。请建议一种自动防故障方法。我假设即使在这种情况下,选择使用Azure Key Vault也不会阻止错误出现。

I am not sure why the private key is lost all of a sudden and why would the exception be thrown. Kindly suggest a fail-safe method. I assume that even with this case, opting for use of a Azure Key Vault would not stop the errors from coming up.

推荐答案

您好d.saravanan,

Hi d.saravanan,

感谢您在此发帖。

根据您的问题与Azure网络应用程序更相关,您可以发布新帖子in  Azure
和ASP.NET
论坛以获得合适的支持。

According to your question is more related to Azure web app, you could post a new thread in Azure and ASP.NET forum for suitable support.

Visual C#讨论并询问C#编程语言,IDE,图书馆,样本和工具。

The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

如果您有一些语法或代码错误,请随时与我们联系。我们将尽力为您提供解决方案。

If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

感谢您的理解与合作。

最诚挚的问候,

Wendy


这篇关于无法读取X509Certificate2私钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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