升級到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