Page 1 of 1

Digital signature and timestamp

Posted: Fri May 18, 2012 11:05 am
by atheohar
Hello,
I am trying to utilise the digital signature together with a TSA server timestamp.
I got these signatures from you
The function signatures for setting the time stamp server are:

PXCPRO40_API HRESULT XCPAPI PXCp_SetTSAServerA(PDFDocument* pdf, LPCSTR lpszServerURL, LPCSTR lpszUser, LPCSTR lpszPassword);

PXCPRO40_API HRESULT XCPAPI PXCp_SetTSAServerW(PDFDocument* pdf, LPCWSTR lpszServerURL, LPCWSTR lpszUser, LPCWSTR lpszPassword);

and I ve tried it with two different ways in my code
// Sign the document
[DllImport(@"C:\Program Files (x86)\Zetadocs Server\Document Converter\xcpro40.dll")]
public static extern int PXCp_SignDocumentUsingPFXW(int pdfHandle, [MarshalAs(UnmanagedType.LPWStr)] string pwFileName,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszPFXPassword,
int pageIndex,
ref PXC_RectF rect,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszReason,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszLocation,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszContactInfo,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszImageFile,
int dwFlags
);

[DllImport(@"C:\Program Files (x86)\Zetadocs Server\Document Converter\xcpro40.dll")]
public static extern int PXCp_SetTSAServerW(
ref IntPtr pdf,
[MarshalAs(UnmanagedType.LPWStr)] string serverURL,
[MarshalAs(UnmanagedType.LPWStr)] string user,
[MarshalAs(UnmanagedType.LPWStr)] string password);

and

// Sign the document
[DllImport(@"C:\Program Files (x86)\Zetadocs Server\Document Converter\xcpro40.dll")]
public static extern int PXCp_SignDocumentUsingPFXW(int pdfHandle, [MarshalAs(UnmanagedType.LPWStr)] string pwFileName,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszPFXPassword,
int pageIndex,
ref PXC_RectF rect,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszReason,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszLocation,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszContactInfo,
[MarshalAs(UnmanagedType.LPWStr)] string lpwszImageFile,
int dwFlags
);

[DllImport(@"C:\Program Files (x86)\Zetadocs Server\Document Converter\xcpro40.dll")]
public static extern int PXCp_SetTSAServerW(
int pdfHandle,
[MarshalAs(UnmanagedType.LPWStr)] string serverURL,
[MarshalAs(UnmanagedType.LPWStr)] string user,
[MarshalAs(UnmanagedType.LPWStr)] string password);

The PXCp_SignDocumentUsingPFXW method works perfectly but when I try to use the PXCp_SetTSAServerW call i get the following error
Unable to find an entry point named 'PXCp_SetTSAServerW' in DLL 'C:\Program Files (x86)\Zetadocs Server\Document Converter\xcpro40.dll'.
Do I have to get a specific xcpro40.dll that contains this function? I ve downloaded your latest version and it seems it does not include this function in the documentation either.
Thank you in advance,
Antonis

Re: Digital signature and timestamp

Posted: Fri May 18, 2012 12:24 pm
by Tracker Supp-Stefan
Hello Antonis,

Could you please make sure that you are using the latest build of our SDK, and that all the files you use are also for build 201?

Best,
Stefan