HashAlgorithmName HashAlgorithmName HashAlgorithmName HashAlgorithmName Struct

定义

指定加密哈希算法的名称。Specifies the name of a cryptographic hash algorithm.

public value class HashAlgorithmName : IEquatable<System::Security::Cryptography::HashAlgorithmName>
public struct HashAlgorithmName : IEquatable<System.Security.Cryptography.HashAlgorithmName>
type HashAlgorithmName = struct
Public Structure HashAlgorithmName
Implements IEquatable(Of HashAlgorithmName)
继承
HashAlgorithmNameHashAlgorithmNameHashAlgorithmNameHashAlgorithmName
实现

注解

HashAlgorithmName结构包括一些静态属性, 这些属性返回预定义的哈希算法名称Name , 以及可表示自定义哈希算法名称作为强类型字符串的属性。The HashAlgorithmName structure includes some static properties that return predefined hash algorithm names, as well as a Name property that can represent a custom hash algorithm name as a strongly-typed string. 哈希算法名称区分大小写。Hash algorithm names are case-sensitive.

使用 Microsoft 的 CNG (下一代加密) API 实现的非对称算法将基础字符串值解释为CNG 算法标识符Asymmetric algorithms implemented using Microsoft's CNG (Cryptographic Next Generation) API interpret the underlying string value as a CNG algorithm identifier.

使用其他技术实现的非对称算法:Asymmetric algorithms implemented using other technologies:

  • 必须至少识别 "MD5"、"SHA1"、"SHA256"、"SHA384" 和 "SHA512"。Must recognize at least "MD5", "SHA1", "SHA256", "SHA384", and "SHA512".

  • 应识别它们支持的任何其他哈希算法的其他 CNG 标识符。Should recognize additional CNG identifiers for any additional hash algorithms that they support.

由于 MD5 和 SHA1 出现冲突, Microsoft 建议使用基于 SHA256 或更好的安全模型。Due to collision problems with MD5 and SHA1, Microsoft recommends a security model based on SHA256 or better.

构造函数

HashAlgorithmName(String) HashAlgorithmName(String) HashAlgorithmName(String) HashAlgorithmName(String)

初始化具有自定义名称的 HashAlgorithmName 结构的新实例。Initializes a new instance of the HashAlgorithmName structure with a custom name.

属性

MD5 MD5 MD5 MD5

获取表示“MD5”的哈希算法名称。Gets a hash algorithm name that represents "MD5".

Name Name Name Name

获取算法名称的基础字符串表示形式。Gets the underlying string representation of the algorithm name.

SHA1 SHA1 SHA1 SHA1

获取表示“SHA1”的哈希算法名称。Gets a hash algorithm name that represents "SHA1".

SHA256 SHA256 SHA256 SHA256

获取表示“SHA256”的哈希算法名称。Gets a hash algorithm name that represents "SHA256".

SHA384 SHA384 SHA384 SHA384

获取表示“SHA384”的哈希算法名称。Gets a hash algorithm name that represents "SHA384".

SHA512 SHA512 SHA512 SHA512

获取表示“SHA512”的哈希算法名称。Gets a hash algorithm name that represents "SHA512".

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

返回一个指示当前实例是否与指定对象相等的值。Returns a value that indicates whether the current instance and a specified object are equal.

Equals(HashAlgorithmName) Equals(HashAlgorithmName) Equals(HashAlgorithmName) Equals(HashAlgorithmName)

返回一个值,该值指示两个 HashAlgorithmName 实例是否相等。Returns a value that indicates whether two HashAlgorithmName instances are equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

返回当前实例的哈希代码。Returns the hash code for the current instance.

ToString() ToString() ToString() ToString()

返回当前 HashAlgorithmName 实例的字符串表示形式。Returns the string representation of the current HashAlgorithmName instance.

操作员

Equality(HashAlgorithmName, HashAlgorithmName) Equality(HashAlgorithmName, HashAlgorithmName) Equality(HashAlgorithmName, HashAlgorithmName) Equality(HashAlgorithmName, HashAlgorithmName)

确定两个指定的 HashAlgorithmName 对象是否相等。Determines whether two specified HashAlgorithmName objects are equal.

Inequality(HashAlgorithmName, HashAlgorithmName) Inequality(HashAlgorithmName, HashAlgorithmName) Inequality(HashAlgorithmName, HashAlgorithmName) Inequality(HashAlgorithmName, HashAlgorithmName)

确定两个指定的 HashAlgorithmName 对象是否不相等。Determines whether two specified HashAlgorithmName objects are not equal.

适用于