What PKT

Over the last several months I’ve had to obtain the Public Key Token from a strong key or a signed dll for verification countless times. So many times I decided to write a script to do it for me. The .NET Strong Name Tool to the rescue. Use the code snippets below:

  • getPublicKeyToken.cmd –> pass file path to *.snk or ‘*.dll’ and presto out pops the PKT.
  • getPublicKeyTokenProcessDir.cmd –> pass dir path and presto out pops PKTs for each dll in the directory.

Hope this will help someone else.