Can strong naming an assembly be used to verify the assembly author?

前端 未结 5 1264
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 00:45

I have been reading the proper article in MSDN, Strong-Named Assemblies and a related Stack Overflow question, Checking an assembly for a strong name.

5条回答
  •  情话喂你
    2020-12-01 00:53

    If you want to integrity check your assembly, you have to make the public key token check (see above "HTTP 410"'s answer) and a check with StrongNameSignatureVerificationEx (https://docs.microsoft.com/de-de/dotnet/framework/unmanaged-api/strong-naming/strongnamesignatureverificationex-function). Both the result of StrongNameSignatureVerificationEx and the out-parameter pfWasVerified must be true. Just use one signing key file (.snk) for all your assemblies.

    Better would be a good .NET assembly obfuscator like BabelFor.Net or so. Many of them have a built-in anti-tampering check.

    Cheers

提交回复
热议问题