Assembly loaded =
Assembly.LoadFile(path);
byte[] evidenceKey =
loaded.GetName().GetPublicKey();
if (evidenceKey != null)
{
byte[] internalKey =
Assembly.GetExecutingAssembly().GetName().GetPublicKey();
if (evidenceKey.SequenceEqual(internalKey))
{
return extension;
}
}
[DllImport("mscoree.dll", CharSet=CharSet.Unicode)]
static extern bool StrongNameSignatureVerificationEx(string wszFilePath, bool fForceVerification, ref bool pfWasVerified);