Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

HashAlgorithmName Struct

Definition

Namespace:
System.Security.Cryptography
Assemblies:
netstandard.dll, System.Security.Cryptography.dll
Assemblies:
netstandard.dll, System.Security.Cryptography.Primitives.dll
Assembly:
System.Security.Cryptography.Primitives.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
HashAlgorithmName.cs
Source:
HashAlgorithmName.cs
Source:
HashAlgorithmName.cs
Source:
HashAlgorithmName.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Specifies the name of a cryptographic hash algorithm.

public value class HashAlgorithmName : IEquatable<System::Security::Cryptography::HashAlgorithmName>
public readonly struct HashAlgorithmName : IEquatable<System.Security.Cryptography.HashAlgorithmName>
public struct HashAlgorithmName : IEquatable<System.Security.Cryptography.HashAlgorithmName>
type HashAlgorithmName = struct
Public Structure HashAlgorithmNameImplements IEquatable(Of HashAlgorithmName)
Inheritance
HashAlgorithmName
Implements

Remarks

TheHashAlgorithmName structure includes some static properties that return predefined hash algorithm names, as well as aName 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 aCNG 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.

Due to collision problems with MD5 and SHA-1, Microsoft recommends a security model based on SHA-256 or better.

Constructors

NameDescription
HashAlgorithmName(String)

Initializes a new instance of theHashAlgorithmName structure with a custom name.

Properties

NameDescription
MD5

Gets a hash algorithm name that represents "MD5".

Name

Gets the underlying string representation of the algorithm name.

SHA1

Gets a hash algorithm name that represents "SHA1".

SHA256

Gets a hash algorithm name that represents "SHA256".

SHA3_256

Gets aHashAlgorithmName representing "SHA3-256"

SHA3_384

Gets aHashAlgorithmName representing "SHA3-384"

SHA3_512

Gets aHashAlgorithmName representing "SHA3-512"

SHA384

Gets a hash algorithm name that represents "SHA384".

SHA512

Gets a hash algorithm name that represents "SHA512".

Methods

NameDescription
Equals(HashAlgorithmName)

Returns a value that indicates whether twoHashAlgorithmName instances are equal.

Equals(Object)

Returns a value that indicates whether the current instance and a specified object are equal.

FromOid(String)

Converts the specified OID to a hash algorithm name.

GetHashCode()

Returns the hash code for the current instance.

ToString()

Returns the string representation of the currentHashAlgorithmName instance.

TryFromOid(String, HashAlgorithmName)

Tries to convert the specified OID to a hash algorithm name.

Operators

NameDescription
Equality(HashAlgorithmName, HashAlgorithmName)

Determines whether two specifiedHashAlgorithmName objects are equal.

Inequality(HashAlgorithmName, HashAlgorithmName)

Determines whether two specifiedHashAlgorithmName objects are not equal.

Applies to

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?