My scenario is we have one program (exe) that will start other programs if found in a particular folder. I want to ensure it only ever starts programs which are signed with our
You can try three option here.
1) The first one is using Assembly load like here:
Assembly myDll =
Assembly.Load("myDll, Version=1.0.0.1, Culture=neutral, PublicKeyToken=9b35aa32c18d4fb1");
You can print the hexadecimal format of the public key and public key token for a specific assembly by using the following Strong Name (Sn.exe) command:
sn -Tp
If you have a public key file, you can use the following command instead (note the difference in case on the command-line option):
sn -tp
2) The second one is mentioned here. And use p/Invoke for such issue.
3) Also exists third, more agile, and more complex way for doing this. This is a Binding Policy. You can take it into account in the case when you should to provide upgrades for an application that's already deployed. When a new version of a shared component comes out that your application can benefit from, an application policy file will allow you to provide these benefits without recompiling or replacing existing installations.
You can find more about this feature here:
http://msdn.microsoft.com/en-us/library/aa309359%28v=vs.71%29.aspx
http://ondotnet.com/pub/a/dotnet/2003/03/17/bindingpolicy.html