2016-04-20 8 views
9

以下のPowerShell commandは、SHA1を署名アルゴリズムとして使用して自己署名証明書を作成します。KeyAlgorithm for SHA256

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

MyCertificate

(例:-KeyAlgorithm)私は、このコマンドに渡すことができます任意の値が存在署名アルゴリズムとしてSHA256を使用して生成された証明書を作成するには?

答えて

13

KeyAlgorithmパラメータは、署名アルゴリズム(あなたが達成しようとしているもの)に関係しない公開鍵アルゴリズムを定義します。代わりに、-HashAlgorithmパラメータを使用し、パラメータ値としてSHA256を指定する必要があります。

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