Skip to Content
Programming .NET Security
book

Programming .NET Security

by Adam Freeman, Allen Jones
June 2003
Intermediate to advanced
714 pages
22h 8m
English
O'Reilly Media, Inc.
Content preview from Programming .NET Security

Name

Hash

Synopsis

public sealed class Hash : System.Runtime.Serialization.ISerializable, IBuiltInEvidence {
// Public Constructors
   public Hash(System.Reflection.Assembly assembly);
// Public Instance Properties
   public byte[  ] MD5{get; }
   public byte[  ] SHA1{get; }
// Public Instance Methods
   public byte[  ] GenerateHash(System.Security.Cryptography.HashAlgorithm hashAlg);
   public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, 
        System.Runtime.Serialization.StreamingContext context);
 // implements ISerializable
   public override string ToString(  );    
// overrides object
}

The Hash evidence class represents the hash value of an assembly’s content. Unlike the other standard evidence classes, Hash provides multiple evidence values (hash values) from a single set of source data. The evidence data source is a System.Reflection.Assembly object that is passed to the Hash object constructor. The MD5 and SHA1 properties calculate and return the MD5 and SHA1 hash values for the content of the Assembly. The GenerateHash( ) method allows any hashing implementation that derives from System.Security.Cryptography.HashAlgorithm to be used to generate a hash value of the Assembly content.

During policy resolution, the HashMembershipCondition class uses Hash evidence to evaluate whether code qualifies for membership of a CodeGroup.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

.NET Framework Security

.NET Framework Security

Brian A. LaMacchia, Sebastian Lange, Matthew Lyons, Rudi Martin, Kevin T. Price
.NET Security and Cryptography

.NET Security and Cryptography

Peter Thorsteinson, G. Gnana Arun Ganesh
ASP.NET Core Security

ASP.NET Core Security

Christian Wenz

Publisher Resources

ISBN: 0596004427Supplemental ContentErrata Page