How to retrieve and decode a timestamp date property from authenticode signed files in .NET
I recently found here a very informative article about getting various informations from Authenticode signed executables:
Get timestamp from Authenticode Signed files in .NET
I managed how to retrieve TimeStamp date attribute but i don't know much about raw data conversion, and I assume i开发者_StackOverflow社区t has to be done to convert that attribute from byte array to DateTime object.
Could anyone give me an example how to achive this in C#?
Thanks.
You can re-use the code from Mono's chktrust tool [1] which use Mono.Security.dll [2] to decode Authenticode signatures, including the timestamps. All the code is available under the MIT X.11 license.
[1] https://github.com/mono/mono/blob/master/mcs/tools/security/chktrust.cs
[2] https://github.com/mono/mono/tree/master/mcs/class/Mono.Security
精彩评论