升级到Windows Management Framework 5.0后,在启用DSC配置时,我已经开始收到以下异常。加密证书必须包含数据加密或密钥加密
ConvertTo-MOFInstance : System.ArgumentException error processing property 'Password' OF TYPE 'MSFT_Credential': Certificate
'---HIDDEN-CERTIFICATE-THUMPRINT-VALUE---' cannot be used for encryption. Encryption certificates must contain the Data Encipherment or Key
Encipherment key usage, and include the Document Encryption Enhanced Key Usage (1.3.6.1.4.1.311.80.1).
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:303 char:13
+ ConvertTo-MOFInstance MSFT_Credential $newValue
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], InvalidOperationException
在每个节点上使用的证书是使用以下证书请求生成的自签名证书。然后
[NewRequest]
Subject = CN=[computer-name-here].dsc
KeyLength = 2048
MachineKeySet = true
RequestType = Cert
KeySpec = AT_KEYEXCHANGE
该请求文件被馈送到certreq
命令行实用程序来生成证书并将其加载到cert:\LocalMachine\My
证书存储。
我已经尝试将以下内容添加到基于documentation for the certreq tool的证书申请文件中,但我仍然遇到同样的问题。
KeyUsage = 0x30
[Strings]
szOID_ENHANCED_KEY_USAGE = "1.3.6.1.4.1.311.80.1"
设置KeyUsage
到0x30
同时启用密钥加密和数据加密。但是,我似乎无法找到有关生成的证书中增强的密钥用法的详细信息。也许我在请求中错误地设置了这个值。
请帮忙。
我喜欢纯粹的powershell版本,而不是依靠'certreq'。 – Cobster