Groups | Blog | Home
all groups > dotnet security > november 2005 >

dotnet security : How do I programmatically verify that strong naming is turned off


Ganesh
11/29/2005 4:46:55 PM
I have a requirement to throw an error if the end user turned off strong
named validation for the assembly or any of its calling assemblies using
the sn tool.

I know I can make the check using the sn tool, but I want to do it
during runtime.

regards
Nicole Calinoiu
11/30/2005 10:15:40 AM
I've never come across any built-in API for this. You can, however, read
the list of the verification skip entries from the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification registry key.

BTW, do you need to throw even if the assembly and/or key's presence on the
skip list had no effect (i.e.: if the assembly was fully and validly
signed)? If not, you might want to consider re-validating the assembly
rather than examining the skip list. The StrongNameSignatureVerificationEx
function can be used for this. See
http://blogs.msdn.com/shawnfa/archive/2004/06/07/150378.aspx for details.



[quoted text, click to view]

Ganesh
12/1/2005 4:36:55 PM
Thanks a lot Nicole...

I was exactly looking for this API... Will try and see if it works


Ganesh
[quoted text, click to view]
AddThis Social Bookmark Button