在运行Windows Server 2016的RDSH服务器上安装以下证书:
COMODO RSA Domain Validation Secure Server CA *.internal.<Internet domain name> 02 e5 52 95 aa 2d 9f a5 fb ad 82 97 0e 66 5d a9 73 db 00 ca 我们需要使用上述证书签署一个RDP文件,研究强烈build议使用rdpsign。
我执行命令rdpsign -? 其中发现了以下几点:
NAME rdpsign [options] [items to sign] OPTIONS /sha256 HASH Specified the SHA256 hash of the signing certificate. /q Quiet mode: No output when success, minimal output when failed. /v Verbose mode: Display all warnings, messages, and status. /l Test signing and output results without actually replacing any of the inputs. Ignores when input files are on stdin. All rdp file(s) have been succesfully signed.
所以,与正式的现在过时的文档相反, rdpsign需要证书的SHA-256哈希。
但是,IISpipe理器和证书pipe理器只提供证书的SHA-1指纹。
https://knowledge.symantec.com/support/identity-protection-support/index?page=content&id=SO28771&actp=RSS&viewlocale=zh_CNbuild议可以使用OpenSSL获取证书的各种散列,包括SHA-256。
我将没有私钥的证书导出到base-64编码的X.509 CER文件。
我执行命令openssl x509 -noout -fingerprint -sha1 -inform pem -in <file name>.cer ,输出以下内容:
SHA1 Fingerprint=02:E5:52:95:AA:2D:9F:A5:FB:AD:82:97:0E:66:5D:A9:73:DB:00:CA
所以,我们可以确信,由于SHA-1指纹匹配,OpenSSL正在输出准确的信息。
我执行命令openssl x509 -noout -fingerprint -sha256 -inform pem -in <file name>.cer它输出以下内容:
SHA256 Fingerprint=D7:44:A5:BA:94:56:B0:9F:26:D2:2B:88:92:84:11:74:35:23:71:87:30:FD:CE:D0:B1:35:6B:D8:DA:A6:A1:7B
我执行boost(如运行pipe理员)命令rdpsign /sha256 D744A5BA9456B09F26D22B88928411743523718730FDCED0B1356BD8DAA6A17B <file name>.rdp /v , rdpsign /sha256 "D744A5BA9456B09F26D22B88928411743523718730FDCED0B1356BD8DAA6A17B" <file name>.rdp /v ,和rdpsign /sha256 d744a5ba9456b09f26d22b88928411743523718730fdced0b1356bd8daa6a17b <file name>.rdp /v所有这些输出如下:
Unable locate the certificate specified. Error Code: 0x80092004 The rdp file could not be signed. Error Code: 0x80092004
我发现这个问题几乎没有任何相关的在线。 任何人都可以build议吗?
我猜参数名称是误导性的。 它似乎假定它将使用SHA-256algorithm对文件进行签名,但接受SHA-1证书指纹作为值。
testing了Windows 10计算机上的rdpsign.exe ,并能够使用具有签名散列algorithmSHA-256的已安装证书的SHA-1指纹签名RDP文件。 如果您的证书可以对其进行签名,则以下命令应执行此操作。
rdpsign.exe /sha256 02e55295aa2d9fa5fbad82970e665da973db00ca <rdp file path>
当我使用具有SHA-1签名algorithm的旧版本证书时,rdpsign.exe会生成错误:
无法使用指定的证书进行签名。 错误代码:0x8007000d rdp文件不能被签名。 错误代码:0x8007000d