Print Page | Close Window

Signature Error

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3958
Printed Date: 02 May 24 at 10:59AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Signature Error
Posted By: TBrady12
Subject: Signature Error
Date Posted: 30 Nov 21 at 1:51AM
I use DPLNewSignProcessFromFile and other functions rather than DPLSignFile,
and those functions work fine, but it worked weird with one Windows10 environment.
The resulting PDF file contains only '0' as signature, yet still no error
from DPL functions with this case.
Acrobat Reader says, of course, that the signature is invalid.

Does anybody know what's going on or see similar result? Any advice?


/Filter /Adobe.PPKLite
/SubFilter /adbe.pkcs7.detached
/Contents <0000000000000000000000000000000000000000 ....
/ByteRange [ 0 13275227 13275741 704
]
/M (D:20211118154446-05'00')



Replies:
Posted By: Ingo
Date Posted: 01 Dec 21 at 8:08PM
Hi Tony,

only on one win10-system and on other win10-systems it works?
Can we take a look into the relevant code part you're using?
Here you can look into a sample about how to do it:
https://www.debenu.com/kb/advanced-options-signing-pdf-files/

Here's the description of the function and there you can read that pkcs12 is necessary - you wanna try it with pkcs7:
https://www.debenu.com/docs/pdf_library_reference/SignFile.php

Cheers and welcome here,
Ingo




-------------
Cheers,
Ingo



Posted By: TBrady12
Date Posted: 04 Dec 21 at 12:01AM

Hi Ingo, thank you for your response.

Yes, it worked on one Win-10 System, but not on the other Win-10 System.
 
PFX data is in PKCS12 format.
DPLSetSignProcessSubFilter only supports pkcs7 subfilter.

Here is the code we use.

// This function is a substitution of DPLSignFile function, as it lacks the ability to specify the hashing algorithm,
// DPLSetSignProcessSubFilter is doing the job in this function.

   int procID = DPLNewSignProcessFromFile(instanceID, inputFileName, openPassword);

   int rc = DPLSetSignProcessField(instanceID, procID, signatureFieldName);
   if (rc != DPL_SUCCESS) {
      return rc;
   }
   rc = DPLSetSignProcessInfo(instanceID, procID, reason, location , contactInfo);
   if (rc != DPL_SUCCESS) {
      return rc;
   }
   rc = DPLSetSignProcessSubFilter(instanceID, procID, 5 /*adbe_pkcs7_detached_with_sha512*/);
   if (rc != DPL_SUCCESS) {
      return rc;
   }
   rc = DPLSetSignProcessPFXFromString(instanceID, procID, pfxBuffer, pfxPassword);
   if (rc != DPL_SUCCESS) {
      return rc;
   }
   DPLEndSignProcessToFile(instanceID, procID, outputFileName);
   rc = DPLGetSignProcessResult(instanceID, procID);
   if (rc != DPL_SUCCESS) {
      return rc;
   }
   return rc;




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk