How to generate an Authenticode Hash in C#?

2019-09-15 07:49发布

问题:

I am looking into the feasibility of generating XML files that can be imported into AppLocker. According to the post I have seen here, AppLocker generates a SHA2 Authenticode hash despite it showing SHA256 as being the hash type.

I have been looking at the hash algorithms available in the System.Security.Cryptography namespace, but I cannot find one for a SHA2 Authenticode. Is this possible to do in .NET?

Thanks

回答1:

You can use System.Security.Cryptography.SHA256

Here is MSDN article about SHA256 Class and there is example how to use it MSDN



标签: c# hash