HashAlgorithmName Structure

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Specifies the name of a cryptographic hash algorithm.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public struct HashAlgorithmName : IEquatable<HashAlgorithmName>

NameDescription
System_CAPS_pubmethodHashAlgorithmName(String)

Initializes a new instance of the HashAlgorithmName structure with a custom name.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticMD5

Gets a hash algorithm name that represents "MD5".

System_CAPS_pubpropertyName

Gets the underlying string representation of the algorithm name.

System_CAPS_pubpropertySystem_CAPS_staticSHA1

Gets a hash algorithm name that represents "SHA1".

System_CAPS_pubpropertySystem_CAPS_staticSHA256

Gets a hash algorithm name that represents "SHA256".

System_CAPS_pubpropertySystem_CAPS_staticSHA384

Gets a hash algorithm name that represents "SHA384".

System_CAPS_pubpropertySystem_CAPS_staticSHA512

Gets a hash algorithm name that represents "SHA512".

NameDescription
System_CAPS_pubmethodEquals(HashAlgorithmName)

Returns a value that indicates whether two HashAlgorithmName instances are equal.

System_CAPS_pubmethodEquals(Object)

Returns a value that indicates whether the current instance and a specified object are equal. (Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for the current instance. (Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the string representation of the current HashAlgorithmName instance. (Overrides ValueType.ToString().)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(HashAlgorithmName, HashAlgorithmName)

Determines whether two specified HashAlgorithmName objects are equal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(HashAlgorithmName, HashAlgorithmName)

Determines whether two specified HashAlgorithmName objects are not equal.

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.

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:

  • Must recognize at least "MD5", "SHA1", "SHA256", "SHA384", and "SHA512".

  • Should recognize additional CNG identifiers for any additional hash algorithms that they support.

.NET Framework
Available since 4.6

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: