Hash 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供關於組裝的雜湊值的證據。 此類別無法獲得繼承。
public ref class Hash sealed : System::Security::Policy::EvidenceBase, System::Runtime::Serialization::ISerializable
public ref class Hash sealed : System::Runtime::Serialization::ISerializable
public sealed class Hash : System.Security.Policy.EvidenceBase, System.Runtime.Serialization.ISerializable
[System.Serializable]
public sealed class Hash : System.Runtime.Serialization.ISerializable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class Hash : System.Runtime.Serialization.ISerializable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class Hash : System.Security.Policy.EvidenceBase, System.Runtime.Serialization.ISerializable
type Hash = class
inherit EvidenceBase
interface ISerializable
[<System.Serializable>]
type Hash = class
interface ISerializable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Hash = class
interface ISerializable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Hash = class
inherit EvidenceBase
interface ISerializable
Public NotInheritable Class Hash
Inherits EvidenceBase
Implements ISerializable
Public NotInheritable Class Hash
Implements ISerializable
- 繼承
- 繼承
-
Hash
- 屬性
- 實作
備註
雜湊值代表對應特定位元組的唯一值。 雜湊值不會以名稱、版本或其他名稱來指稱組裝,而是毫無歧義地標示該組裝。 在極少數情況下,名稱會發生碰撞,因為相同名稱被賦予完全不同的代碼。 不同版本的程式碼可能會意外被標記為相同版本。 然而,即使只改變一個位元,雜湊值也會大不相同。
雜湊值是一種加密學上安全的方式,可在不使用數位簽章的情況下,在政策中指稱特定組合。 安全雜湊演算法的設計使得無論意外或惡意嘗試,都無法計算出具有相同雜湊值的其他組裝。 預設情況下,支援來自 和 SHA1 雜湊演算法的證據MD5,儘管任何雜湊演算法都可以透過 GenerateHash來使用。
由於 MD5 與 SHA-1 有衝突問題,Microsoft 建議採用以 SHA-256 或更完善的安全模型。
建構函式
| 名稱 | Description |
|---|---|
| Hash(Assembly) |
初始化 Hash 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| MD5 |
取得 MD5 組裝的雜湊值。 |
| SHA1 |
取得 SHA1 組裝的雜湊值。 |
| SHA256 |
取得 SHA256 組裝的雜湊值。 |
方法
| 名稱 | Description |
|---|---|
| Clone() |
建立一個新的物件,該物件是目前實例的複製品。 |
| Clone() |
建立一個新物件,該物件是目前實例的完整副本。 (繼承來源 EvidenceBase) |
| CreateMD5(Byte[]) | |
| CreateSHA1(Byte[]) | |
| CreateSHA256(Byte[]) | |
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GenerateHash(HashAlgorithm) |
利用指定的雜湊演算法計算組裝的雜湊值。 |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetObjectData(SerializationInfo, StreamingContext) |
已淘汰.
取得 SerializationInfo 帶有參數名稱及額外例外資訊的物件。 |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
回傳當前 Hash的字串表示。 |