ECDiffieHellmanCng.HashAlgorithm 属性

定义

获取或设置生成密钥材料时要使用的哈希算法。Gets or sets the hash algorithm to use when generating key material.

public:
 property System::Security::Cryptography::CngAlgorithm ^ HashAlgorithm { System::Security::Cryptography::CngAlgorithm ^ get(); void set(System::Security::Cryptography::CngAlgorithm ^ value); };
public System.Security.Cryptography.CngAlgorithm HashAlgorithm { get; set; }
member this.HashAlgorithm : System.Security.Cryptography.CngAlgorithm with get, set
Public Property HashAlgorithm As CngAlgorithm

属性值

一个指定哈希算法的对象。An object that specifies the hash algorithm.

异常

该值为 null.The value is null.

注解

仅当在Hash KeyDerivationFunction属性中设置了或Hmac值时, 下一代加密技术 (CNG) 对象才使用此属性。This property is used by Cryptography Next Generation (CNG) objects only if the Hash or Hmac value is set in the KeyDerivationFunction property.

此属性接受以下算法: MD5Sha1Sha256Sha384Sha512This property accepts the following algorithms: MD5, Sha1, Sha256, Sha384, and Sha512.

还可以使用其他自定义哈希算法。Other custom hash algorithms may also be used.

由于 MD5 和 SHA1 出现冲突, Microsoft 建议Sha256您这样做。Due to collision problems with MD5 and SHA1, Microsoft recommends Sha256. 默认算法为Sha256The default algorithm is Sha256.

适用于