HashAlgorithmName 結構
定義
指定密碼編譯雜湊演算法的名稱。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)
- 繼承
- 實作
備註
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 結構的執行個體。Initializes a new instance of the HashAlgorithmName structure with a custom name. |
屬性
MD5 |
取得代表 "MD5" 的雜湊演算法名稱。Gets a hash algorithm name that represents "MD5". |
Name |
取得代表演算法名稱的基礎字串。Gets the underlying string representation of the algorithm name. |
SHA1 |
取得代表 "SHA1" 的雜湊演算法名稱。Gets a hash algorithm name that represents "SHA1". |
SHA256 |
取得代表 "SHA256" 的雜湊演算法名稱。Gets a hash algorithm name that represents "SHA256". |
SHA384 |
取得代表 "SHA384" 的雜湊演算法名稱。Gets a hash algorithm name that represents "SHA384". |
SHA512 |
取得代表 "SHA512" 的雜湊演算法名稱。Gets a hash algorithm name that represents "SHA512". |
方法
Equals(HashAlgorithmName) |
傳回值,這個值表示兩個 HashAlgorithmName 執行個體是否相等。Returns a value that indicates whether two HashAlgorithmName instances are equal. |
Equals(Object) |
傳回值,指出目前的執行個體與指定物件是否相等。Returns a value that indicates whether the current instance and a specified object are equal. |
FromOid(String) |
將指定的 OID 轉換成雜湊演算法名稱。Converts the specified OID to a hash algorithm name. |
GetHashCode() |
傳回目前執行個體的雜湊碼。Returns the hash code for the current instance. |
ToString() |
傳回目前 HashAlgorithmName 執行個體的字串表示。Returns the string representation of the current HashAlgorithmName instance. |
TryFromOid(String, HashAlgorithmName) |
嘗試將指定的 OID 轉換成雜湊演算法名稱。Tries to convert the specified OID to a hash algorithm name. |
運算子
Equality(HashAlgorithmName, HashAlgorithmName) |
判斷指定的兩個 HashAlgorithmName 物件是否相等。Determines whether two specified HashAlgorithmName objects are equal. |
Inequality(HashAlgorithmName, HashAlgorithmName) |
判斷指定的兩個 HashAlgorithmName 物件是否相等。Determines whether two specified HashAlgorithmName objects are not equal. |