【问题标题】:KeyAlgorithm for SHA256SHA256 的密钥算法
【发布时间】:2016-08-12 12:29:07
【问题描述】:

下面的PowerShell command 创建一个以SHA1 作为签名算法的自签名证书。

New-SelfSignedCertificate -DnsName "MyCertificate", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My" -Provider "Microsoft Strong Cryptographic Provider"

是否有任何值可以传递给此命令(例如:-KeyAlgorithm)以使用 SHA256 作为签名算法生成证书?

【问题讨论】:

    标签: .net powershell msdn x509certificate2


    【解决方案1】:

    KeyAlgorithm 参数定义与签名算法无关的公钥算法(您要完成的工作)。相反,您需要使用-HashAlgorithm 参数并将SHA256 指定为参数值:

    New-SelfSignedCertificate -DnsName "MyCertificate", "www.contoso.com" `
        -CertStoreLocation "cert:\LocalMachine\My" `
        -Provider "Microsoft Strong Cryptographic Provider" `
        -HashAlgorithm "SHA256"
    

    【讨论】:

      猜你喜欢
      • 2013-02-13
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-20
      • 1970-01-01
      相关资源
      最近更新 更多