Prevent external assembly injection via PublicKeyToken

后端 未结 2 1780
南方客
南方客 2021-01-02 03:53

I\'m using the following code:

AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
{
    var token = args.LoadedAssembly.GetName().GetPublicKeyToken         


        
2条回答
  •  -上瘾入骨i
    2021-01-02 04:47

    It would also be safer if you generated the full keys at runtime (perhaps from multiple partial keys). This works around statically examining your binary for keys.

提交回复
热议问题