c# - 创建 CNG key 的权限

标签 c# windows permissions cryptography cng

当我尝试创建机器范围的 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/

相关文章:

Django Rest Framework 自定义权限的消息未显示

Java读取文件权限

c# - 如何检查 C# 的 json 对象中是否存在嵌套路径?

c# - 服务器端属性在 Silverlight 客户端中不可用

windows - Windows 上的 SIGWINCH 等效项?

windows - SSL_CTX_new 进入循环并挂起应用程序

linux - 在 Linux 中创建不可移动的文件

c# - 动态设置新实例类型

c# - 如何检查exe应用程序何时结束?

php - 在独立的 php 和 apache 安装中使用 wamp 堆栈的 mysql