Azure Web应用程序新的X509Certificate2()导致System.Security.Cryptography.CryptographicException:访问被拒绝 [英] Azure Web Application new X509Certificate2() causing System.Security.Cryptography.CryptographicException: Access denied

查看:71
本文介绍了Azure Web应用程序新的X509Certificate2()导致System.Security.Cryptography.CryptographicException:访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我正在上传.pfx文件,输入密码并调用

Right now I am uploading a .pfx file, taking in a password and calling

var cert = new X509Certificate2(fileData, password);

并存储诸如指纹之类的东西.我不需要将其实际存储在服务器上,只需验证它是有效的证书并存储一些信息即可.在本地,这很有效(显然,我可以更好地访问我的密钥存储区),但是当我将其放到天蓝色时,会出现错误:

And storing things like the thumbprint, etc. I do not need to actually store this on the server, just validate that it is a valid cert and store some information. On local this works (obviously I have better access to my key store) but when I put it up in azure I get the error:

System.Security.Cryptography.CryptographicException:访问被拒绝.

System.Security.Cryptography.CryptographicException: Access denied.

是否有任何方法可以使此信息避开此方法或使用此方法而不会导致访问被拒绝?我对证书不是很好,因此,如果您需要更多信息,请告诉我.谢谢.

Is there any way to get this information sidestepping this or to use this method without getting an access denied? I am not very good with certs, so let me know if you need more information. Thank you.

推荐答案

在Windows上打开PFX时,任何私钥都会写入磁盘.它们将在以后被删除(除非您指定PersistKeySet),但是它们仍然必须被写入(ish).

When opening a PFX on Windows any private keys get written to disk. They will get deleted later (unless you specify PersistKeySet), but they do still have to be written (ish).

他们写在哪里?

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