Retrieving Authenticode countersignature time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to port some C++ code to .Net/c#
One function we use retrieves the countersignature time from an authenticode signed dll or exe
Is there a way to do this using existing .Net classes or do I have to use P/Invoke for most of it?
 
Hello,

Thanks for your post. Which function do you call in C++ to retrieve the
countersignature time? I suggest you to check whether your are find
corresponding .NET class method according to the MSDN article below:

Microsoft Win32 to Microsoft .NET Framework API Map
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/win32map.asp

If there is no such mapping, you will have to use P/Invoke.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Which function do you call in C++ to retrieve the countersignature time?

CryptQueryObject, CryptMsgGetParam, and CryptDecodeObject.
These functions are missing from the document you referenced.
Actually it seems that all CryptoAPI functions are missing from that document even though there are some crypto classes in .Net.

Is there a utility that can easily create c# wrappers around API calls and structures and COM interfaces?
Or is there a reference library with all of this already done?
 
Hi,

Thanks for your response. You will need to use P/Invoke to call these
unmanaged APIs in .NET. Please refer to the sample in the following MSDN
artcle:
EncryptTo/DecryptTo: Encryption in .NET with CryptoAPI Certificate Stores
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncapi/html
/encryptdecrypt2a.asp

In addtion, I believe the article below is helpful on P/Invoke:

Consuming Unmanaged DLL Functions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconConsumingUnmanagedDLLFunctions.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top