Hash Classe

Definição

Fornece evidência sobre o valor de hash para um assembly.Provides evidence about the hash value for an assembly. Essa classe não pode ser herdada.This class cannot be inherited.

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
Herança
Herança
Hash
Atributos
Implementações

Comentários

Um valor de hash representa um valor exclusivo que corresponde a um determinado conjunto de bytes.A hash value represents a unique value that corresponds to a particular set of bytes. Em vez de se referir a um assembly por nome, versão ou outra designação, um valor de hash designa o assembly sem ambigüidade.Rather than referring to an assembly by name, version, or other designation, a hash value designates the assembly without ambiguity. Os nomes estão sujeitos a colisões em casos raros em que o mesmo nome é dado a código completamente diferente.Names are subject to collisions in rare cases where the same name is given to completely different code. Diferentes variações de código podem ser acidentalmente marcadas com a mesma versão.Different variations of code can accidentally be marked with the same version. No entanto, mesmo a alteração de um único bit resulta em um valor de hash muito diferente.However, even changing a single bit results in a very different hash value.

Os valores de hash são uma maneira criptograficamente segura de se referir a assemblies específicos na política sem o uso de assinaturas digitais.Hash values are a cryptographically secure way to refer to specific assemblies in policy without the use of digital signatures. Um algoritmo de hash seguro foi projetado para que seja computacionalmente impraticável construir um assembly diferente com o valor de hash idêntico por uma tentativa acidental ou mal-intencionada.A secure hash algorithm is designed so that it is computationally infeasible to construct a different assembly with the identical hash value by either an accidental or malicious attempt. Por padrão, SHA1 MD5 há suporte para evidências dos algoritmos de hash e, embora qualquer algoritmo de hash possa ser usado por meio do GenerateHash .By default, evidence from the SHA1 and MD5 hash algorithms is supported, although any hash algorithm can be used through GenerateHash.

Devido a problemas de colisão com MD5 e SHA1, a Microsoft recomenda um modelo de segurança com base em SHA256 ou melhor.Due to collision problems with MD5 and SHA1, Microsoft recommends a security model based on SHA256 or better.

Construtores

Hash(Assembly)

Inicializa uma nova instância da classe Hash.Initializes a new instance of the Hash class.

Propriedades

MD5

Obtém o valor do hash MD5 para o assembly.Gets the MD5 hash value for the assembly.

SHA1

Obtém o valor do hash SHA1 para o assembly.Gets the SHA1 hash value for the assembly.

SHA256

Obtém o valor do hash SHA256 para o assembly.Gets the SHA256 hash value for the assembly.

Métodos

Clone()

Cria um novo objeto que é uma cópia da instância atual.Creates a new object that is a copy of the current instance.

Clone()

Cria um novo objeto que é uma cópia completa da instância atual.Creates a new object that is a complete copy of the current instance.

(Herdado de EvidenceBase)
CreateMD5(Byte[])

Cria um objeto Hash que contém um valor de hash MD5.Creates a Hash object that contains an MD5 hash value.

CreateSHA1(Byte[])

Cria um objeto Hash que contém um valor de hash SHA1.Creates a Hash object that contains a SHA1 hash value.

CreateSHA256(Byte[])

Cria um objeto Hash que contém um valor de hash SHA256.Creates a Hash object that contains a SHA256 hash value.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GenerateHash(HashAlgorithm)

Calcula o valor de hash para o assembly usando o algoritmo de hash especificado.Computes the hash value for the assembly using the specified hash algorithm.

GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetObjectData(SerializationInfo, StreamingContext)

Obtém o objeto SerializationInfo com o nome do parâmetro e informações adicionais de exceção.Gets the SerializationInfo object with the parameter name and additional exception information.

GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
ToString()

Retorna uma representação de cadeia de caracteres do Hash atual.Returns a string representation of the current Hash.

Aplica-se a