下面的PowerShell命令创建一个以SHA1作为签名算法的自签名证书.
New-SelfSignedCertificate -DnsName "MyCertificate", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My" -Provider "Microsoft Strong Cryptographic Provider"

有什么值可以传递给这个命令(例如:-KeyAlgorithm)使使用SHA256作为签名算法生成的证书?
发布于 2016-04-20 05:19:52
KeyAlgorithm参数定义了与签名算法无关的公钥算法(您要完成的是什么)。相反,您需要使用-HashAlgorithm参数并将SHA256指定为参数值:
New-SelfSignedCertificate -DnsName "MyCertificate", "www.contoso.com" `
-CertStoreLocation "cert:\LocalMachine\My" `
-Provider "Microsoft Strong Cryptographic Provider" `
-HashAlgorithm "SHA256"https://stackoverflow.com/questions/36733439
复制相似问题