System.Security.Policy.Hash Class

Provides evidence about the hash value for an assembly. This class cannot be inherited.

See Also: Hash Members


public sealed class Hash : EvidenceBase, System.Runtime.Serialization.ISerializable, IBuiltInEvidence


A hash value represents a unique value that corresponds to a particular set of bytes. Rather than referring to an assembly by name, version, or other designation, a hash value designates the assembly without ambiguity. Names are subject to collisions in rare cases where the same name is given to completely different code. Different variations of code can accidentally be marked with the same version. However, even changing a single bit results in a very different hash value.

Hash values are a cryptographically secure way to refer to specific assemblies in policy without the use of digital signatures. 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. By default, evidence from the System.Security.Cryptography.SHA1 and System.Security.Cryptography.MD5 hash algorithms is supported, although any hash algorithm can be used through Hash.GenerateHash(System.Security.Cryptography.HashAlgorithm).


Namespace: System.Security.Policy
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,