当我尝试创建机器范围的 CNG 密钥时:
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 密钥的权限的确切权限是什么?可以在哪里设置?