ECDiffieHellmanCng.HashAlgorithm 属性

定义

获取或设置生成密钥材料时要使用的哈希算法。

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

属性值

一个指定哈希算法的对象。

例外

该值为 null

注解

仅当 在 属性中KeyDerivationFunction设置了 或 Hmac 值时Hash,下一代加密 (CNG 才使用此属性) 对象。

此属性接受以下算法:MD5、、、Sha256Sha384、 和 Sha512Sha1

也可以使用其他自定义哈希算法。

由于 MD5 和 SHA1 的冲突问题,Microsoft建议 Sha256。 默认算法为 Sha256

适用于