当我尝试创建机器范围的 CNG key 时:
CngKey.Create(CngAlgorithm2.Rsa, "TestKey", new CngKeyCreationParameters
{
KeyCreationOptions = CngKeyCreationOptions.MachineKey
});
我明白了
System.Security.Cryptography.CryptographicException: Access denied.
at System.Security.Cryptography.NCryptNative.FinalizeKey(SafeNCryptKeyHandle key)
at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters)
它以管理员身份运行时有效,但我需要在 AD 用户帐户下执行此操作,而不将此用户添加到本地管理员。
授予创建 CNG key 的权限的具体权限是什么?可以在哪里设置这些权限?
最佳答案
找到答案。应授予用户对 %ALLUSERSPROFILE%\Application Data\Microsoft\Crypto\Keys
的修改权限。
关于c# - 创建 CNG key 的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32830153/