Search Results

Search found 2 results on 1 pages for 'slavagu'.

Page 1/1 | 1 

  • Get timestamp from Authenticode Signed files in .NET

    - by SlavaGu
    We need to verify that binary files are signed properly with digital signature (Authenticode). This can be achieved with signtool.exe pretty easily. However, we need an automatic way that also verifies signer name and timestamp. This is doable in native C++ with CryptQueryObject() API as shown in this wonderful sample: How To Get Information from Authenticode Signed Executables However we live in a managed world :) hence looking for C# solution to the same problem. Straight approach would be to pInvoke Crypt32.dll and all is done. But there is similar managed API in System.Security.Cryptography.X509Certificates Namespace. X509Certificate2 Class seems to provide some information but no timestamp. Now we came to the original question how can we get that timestamp of a digital signature in C Sharp?

    Read the article

  • Passing a SAFEARRAY from C# to COM

    - by SlavaGu
    I use 3rd party COM to find faces in a picture. One of the methods has the following signature, from SDK: long FindMultipleFaces( IUnknown* pIDibImage, VARIANTARG* FacePositionArray ); Parameters: pIDibImage[in] - The image to search. FacePositionArray[out]- The array of FacePosition2 objects into which face information is placed. This array is in a safe array (VARIANT) of type VT_UNKNOWN. The size of the array dictates the maximum number of faces for which to search. which translates into the following C# method signature (from metadata): int FindMultipleFaces(object pIDibImage, ref object pIFacePositions); Being optimistic I call it the following way but get an exception that the memory is corrupt. The exception is thrown only when a face is present in the image. FacePosition2[] facePositions = new FacePosition2[10]; object positions = facePositions; int faceCount = FaceLocator.FindMultipleFaces(dibImage, ref positions); What's the right way to pass SAFEARRAY to unmanaged code?

    Read the article

1