对象已存在的RSACryptoServiceProvider [英] Object already exists in RSACryptoServiceProvider
问题描述
我复制源代码从一个应用程序到另一个,在同一台机器上都运行。我也是在这两个应用程序中使用下面的容器名称相同的字符串。
什么在阻止我的新的应用程序从读取保存在其他应用程序的关键?所有其他的事情都是平等的,登录的用户帐户等。
CspParameters cspParams =新CspParameters();
cspParams.KeyContainerName =容器;
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
//获取错误对象已存在的。
的RSACryptoServiceProvider rsaKey =新的RSACryptoServiceProvider(cspParams);
你有没有尝试授予权限给大家,比如,在文件和Settings\All Users\Application Data\Microsoft\Crypto\RSA\Machine密钥文件,因为它有描述:
http://social.msdn.microsoft.com/Forums / EN / netfxbcl /线程/ f7b9f928-a794-47f2-a5bd-9f64ca375040
I copied the source code from one application to another, both running on the same machine. I am also using the same string for containerName below in both applications.
What is preventing my new application from reading the key that was saved in the other application? All other things are equal, logged in user account etc.
CspParameters cspParams = new CspParameters();
cspParams.KeyContainerName = containerName;
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
// Get error "object already exists" below.
RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(cspParams);
Did you try to grant permissions to Everyone, for example, for files in "Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\Machine Keys", as it described there:
http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/f7b9f928-a794-47f2-a5bd-9f64ca375040
这篇关于对象已存在的RSACryptoServiceProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!