我正在将现有(并且正在运行)的ASP.NET网站移至Azure网站。网站上的其中一项功能是签署XML文档。拿到钥匙的代码是:在Azure网站上使用RSACryptoServiceProvider导致文件未找到错误
// retrieve a key from the key safe - this will create it if it does not exist yet
System.Security.Cryptography.CspParameters csp = new CspParameters();
csp.KeyContainerName = "MyKeyName";
System.Security.Cryptography.RSACryptoServiceProvider key = new RSACryptoServiceProvider(csp);
最后一行抛出一个CryptographicException,与消息“系统找不到指定的文件”。
我没有把钥匙或容器放入Azure中 - 我的理解是ServiceProvider会创建一个。 我已阅读this article,但没有得到任何线索。
显然我缺少一些基本的东西。
建议你查看回答这个帖子里面应该给你你需要的东西:http://stackoverflow.com/questions/23827884/access-uploaded-certificates-in-azure-web-sites – 2014-11-20 22:40:03