About a week ago, I wrote about verifying strong name signatures from managed code.  There are also several other strong name APIs exposed to unmanged code that don't have any managed equivilent, so I thought it might be a good idea to turn that post into a series of posts porting most of the strong name functionality to managed code.  Once that's done, it should be pretty easy to write a simple managed re-implementation of sn.exe, to demonstrate how all of the APIs are used.  As I do each API, I'll also update the P/Invoke wiki for mscorsn.  (keeping in mind that mscorsn.dll goes away in Whidbey, as it gets merged into mscorwks).

I've been working on this in my spare time over the last week or so, and have come up with this general design:

  • StrongName.Native.dll - contains only P/Invoke wrappers around the strong name functions.
  • StrongName.dll - I haven't decided if this one is necessary or not.  The idea behind it would be to have managed wrappers around the functions exposed in StrongName.Native.dll to give them a more natural feel.
  • ManagedSN.exe - managed port of SN.exe.  This one should be easy once StrongName.Native.dll is implementd.

I'll also use this as an excuse to get ramped up with MSBuild.  However, everything should also work for v1.1 of the framework, since I'll P/Invoke to the mscoree function stubs.  As for the code, I'm not quite sure how I'll handle that yet.  I'll probably start by just storing it in this blog, then possibly move to a better solution such as the gotdotnet workspaces if this idea takes off.  I've also created a new StrongName category on the blog, so that it'll be easy to get all of the posts on this project together.