Quote from CLR via C #
Signing an assembly using a private key ensures that the owner of the corresponding public key assembly. When the assembly is installed in the GAC, the system hashes the contents of the file containing the manifest and comparing the hash value with the digital RSA signature value embedded in the PE file (after it has the public key). If the values ββare identical, the contents of the files havent been tampered with, and you know that you have a public key that matches the publishers of the private key. In addition, the hashes of the system the contents of the assemblies are different files and compares the hash values ββwith the hash values ββstored in the manifest file FileDef. If the hash values ββdo not match, at least one of the assembly files has been tampered with and the assembly will not be installed in the GAC.
Well, here's how it works.
When you compile an assembly, noting that you want to sign it with a pair of public / private key files already created, the compiler calculates the hash of the assembly (also calculates the hashes for each file in the assembly and stores the values ββalong with the file names in the FileDef table), then it signs the hash -value using the private key and inserts the public key into the manifest for this assembly.
Now, when the application (assembly) tries to load the signed assembly, the assembly is hashed again, then the CLR obtains the public key from the assembly manifest and decrypts the RSA sign and compares the hash value with the sign value. If they match, nothing has changed.
source share