Forum


Replies: 1   Views: 1598
Certificate for signing a pdf file
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jeremie  · 16-10-2020 - 14:59

I'm trying to sign a PDF file.

I bought a certificate from GlobalSign. They sent me a .pfx file that I converted to a .pem file. Then I signed the PDF using your code:

require_once $root.'Libraries/phpdocx-premium-9.5/classes/SignPDF.php'; 
$sign = new SignPDF(); 
$sign->setPDF('Test.pdf');
$sign->setPrivateKey('Test.pem', 'phpdocx_pass'); 
$sign->setX509Certificate('Test.pem'); 
$sign->sign('Test_signed.pdf');

'Test_signed.pdf' is created and I can see the signature in it when I open it with Adobe Acrobat Reader.

I can see my name on it, but Adobe displays a message saying that the validity of the certification is uknown because they can't authenticate me.

What am I missing?